Skip to main content
Known Participant
November 16, 2009
Question

index.cfm vs no index.cfm

  • November 16, 2009
  • 1 reply
  • 682 views

Is there a way to tell if the user or the link the user clicked contained index.cfm? I have been playing around with the cgi stuff and getPageContext, but they all say index.cfm no matter if it appears in the URL or not.

Any help is greatly appreciated.

Thanks,

    This topic has been closed for replies.

    1 reply

    ilssac
    Inspiring
    November 16, 2009

    No, because by the time ColdFusion gets it, it IS "index.cfm".

    That is handled at the web server layer, before ColdFusion gets involved.  When the web server gets a directory request, it sends a redirect response header to the browser and the browser submits a second request to the server this one with an 'index.cfm' at the end.  It is this second request that gets handed off to ColdFusion for processing.  It has no idea about all that redirect stuff the browser and the web server did with the first request.

    You can watch this request, redirect request process in your browser with a tool like the "Live HTTP Headers" plugin for Firefox.

    You maybe able to sniff non-standard cgi headers for keys that indicate a redirect was done.  Some web servers apply these.  You would have to search for what your web server may offer.