interviews.dotnetthread.com

↑ Grab this Headline Animator

Tuesday, February 10, 2009

How to retrieve original request URL when using URL rewriting or Server.Transfer in ASP.NET.



The best way to retrieve original Request URL when URL rewriting is implemented is by using Request.ServerVariables("HTTP_X_REWRITE_URL")
This will work with all kinds of URL rewriting methods like using ISAPI filters, HTTP Handlers or Http Modules..


Before any URI modification original Request URI is saved into the HTTP header named X-Rewrite-URL.

And this can be retrieved in ASP.NET using Request.ServerVariables("HTTP_X_REWRITE_URL") alias.

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles