Context.Request.RawUrl different on 2 machines after rewrite

Last post 04-29-2008 9:22 PM by phoenixdigital. 0 replies.

Sort Posts:

  • Context.Request.RawUrl different on 2 machines after rewrite

    04-29-2008, 9:22 PM

    Hi All,

     I have been bashing my head up against a wall trying to work out why on two vista machines running IIS 7.0.6000.16386 running the exact same code we get two different responses from Context.Request.RawUrl

    The page is opened on each machine via a browser as

    http://machine1.com/Regions/348/Adelaide.aspx
    and
    http://machine2.com/Regions/348/Adelaide.aspx
     

    The code behind performs this in the global.axa

            Dim Resource As String = Context.Request.RawUrl
            If (InStr(LCase(Resource), "/regions/") > 0) Then
                System.Web.HttpContext.Current.RewritePath("/Regions.aspx?URL=" & Server.UrlEncode(Resource))
            End If

     

    And the code on the Regions.aspx page when displaying Context.Request.RawUrl is different for each machine

    Machine 1

    Context.Request.RawUrl = /Regions.aspx?URL=%2fRegions%2f348%2fAdelaide.aspx

    Machine 2

    Context.Request.RawUrl = /Regions/348/Adelaide.aspx

     

    Does anyone have a clue what is happening here? The correct behaviour is machine 2 as that is what the 2003 server does.

Page 1 of 1 (1 items)