Search code examples
c#asp.netfriendly-urlurlrewriter

Intelligencia.UrlRewriter


I'm using the Intelligencia UrlRewriter on a project.

It's working fine to rewrite urls typed into the browser.

For example, if I enter

http://localhost/People

This is being correctly rewritten as:

http://localhost/People.aspx

Now, the problem is, when I am in the code behind I need to access the Friendly URL, but Request.ServerVariables seems to only have the unfriendly URL available.

Does anyone know if there's anyway I can access this original, friendly Url in code? Or am I too late?


Solution

  • Got it guys.

    @Nick Allen and Pure.Krome: Thanks for the help!!

    I found the piece of data in:

    HttpContext.Current.Request.RawUrl
    

    If it exists in ServerVariables, I couldn't see it, but in conclusion, the data is there so I won't have to cry myself to sleep :)

    Okay. Thanks again!!