views:

87

answers:

2

I need to be able to get the URL as I see it in the browser i.e The rewritten one. For instance:

If my Url was www.myurl.com/Test.html and I then used Request.Url.AbsoluteUri, the URL returned would be: www.myurl.com/Default.aspx?Action=Test

I need to be able to get back the exact rewritten URL.

Does anyone know how I can achieve this?

A: 

You could rewrite the URL so, that it includes the original URL as a querystring parameter.

For example: url="(.*)" to="http://newurl.com?original=$1".
(Note you'll still have to adjust the regex to work with URLs that contain a querystring.)

Protector one
+1  A: 

From Tchami:

Have you tried Request.RawUrl? I think that gives you the unmapped URL.

Will mark this as the answer when I am allowed.

webnoob