Intelligencia.UrlRewriter
I am using Intelligence UrlRewriter for a project.
It works great to rewrite URLs entered into the browser.
For example, if I enter
http://localhost/People
This is correctly rewritten as:
http://localhost/People.aspx
Now the problem is that when I'm in the code I need to access the friendly url, but Request.ServerVariables only seems to have the unfriendly url.
Does anyone know if anyway I can access this original, friendly url in code? Or am I too late?
a source to share
I have been using it and have been for .. er .. 2 years now I think. (Thanks to gawd IIS7 and MVC here!)
anyway, you can check the IIS Server Variables for all of them and tell us what you get ...
- PATH_INFO
- Url
- SCRIPT_NAME
for example (this is the PATH_INFO snippet for a page I set that dumps ALL request variables): -
PATH_INFO: [/admin/Miscellaneous.aspx]
and get it.
Request.ServerVariables["PATH_INFO"]
Keep us updated.
a source to share
Intelligencia rewrite rules are stored in the web.config file, which is legible. This way you can traverse the rules in your web.config file to find a match and use the matched value from there
Obviously it wouldn't work for pattern matching, only explicit rules like the one in your example
a source to share