Skip to main content
June 28, 2006
Answered

Coldfusion 7 and Isapi_rewrite

Hi, I've got a problem with Coldfusion 7 being used in combination with Isapi_rewrite software for IIS. In CF5 I'm provided with a cgi.http_x_rewrite_url variable containing the original URL before any rewriting has taken place. But in CF7 this has disappeared completely.

The rewriting software is still the first thing that executes in IIS so I don't think it's that and I've run a quick test with an asp page and the variable http_x_rewrite_url still exists there. Which leads me to think that for some reason Coldfusion 7 is ignoring or hidden this somewhere.

Anyone got an idea?

I've even tried going in via the coldfusion.runtime.CgiScope java object and checking the values there but they're no different.

Help!
    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer
    June 28, 2006
    Actually I've just tracked down the problem, but thanks for the suggestion anyway. For anyone interested...

    It appears that for some strange reason, can't think of a valid one myself, Coldfusion 7 is either hiding certain CGI variables or they're accessed via a different method which means they're hidden from certain functions.

    This is the case of my cgi.http_x_rewrite_url but also for cgi.request_uri
    I can't see it in the debug output, <cfdump var="#cgi#">, StructKeyList(cgi) or StructKeyArray(cgi).
    But I can check if it exists using StructKeyExists(cgi, "request_uri") or IsDefined("cgi.request_uri")
    And I can use it just like any normal variable <cfset address = cgi.request_uri>


    Anyone know why this is the way it is?
    It's not really a problem for me now I know, but I'm just curious as to the reason why and how I'd get a list of all the variables including ones hidden like these.

    Cheers

    2 replies

    June 28, 2006
    Try getting it without http inside the variable, i.e. cgi.x_rewrite_url (make sure everything is in CAPS).
    Translate
    Correct answer
    June 28, 2006
    Actually I've just tracked down the problem, but thanks for the suggestion anyway. For anyone interested...

    It appears that for some strange reason, can't think of a valid one myself, Coldfusion 7 is either hiding certain CGI variables or they're accessed via a different method which means they're hidden from certain functions.

    This is the case of my cgi.http_x_rewrite_url but also for cgi.request_uri
    I can't see it in the debug output, <cfdump var="#cgi#">, StructKeyList(cgi) or StructKeyArray(cgi).
    But I can check if it exists using StructKeyExists(cgi, "request_uri") or IsDefined("cgi.request_uri")
    And I can use it just like any normal variable <cfset address = cgi.request_uri>


    Anyone know why this is the way it is?
    It's not really a problem for me now I know, but I'm just curious as to the reason why and how I'd get a list of all the variables including ones hidden like these.

    Cheers
    Translate