How to get the “originally requested” URL using the IIRF URL rewriting mechanism

I use the Iconic IIRF URL rewrite mechanism in IIS, and the "fancy" URLs look something like this:

http://some-website.com/some-function/418/some-keyword-rich-filename.html

This sample URL matches:

http://some-website.com/some-function.asp?SOME-ID=418

Now inside the some-function.asp file, I need to know the page requested by the browser. I went through all the IIS variables, but could not find the value /some-function/418/some-keyword-rich-filename.htmlinside any of them.

As an additional note, I need this information to send 301 redirects to browsers. For instance. if the browser asks:

http://some-website.com/some-function/418/index.html

First I need to send to the browser:

http://some-website.com/some-function/418/some-keyword-rich-filename.html

And that is why I need the original url for comparison.

+3
1

IIRF unmangling U.

IIRF:

U = URL- HTTP_X_REWRITE_URL

U RewriteRule, url. :

RewriteRule ^/some-function/(\d+)/(.*)$ /some-function.asp?SOME-ID=$1 [I,U,L] 

some-function.asp URL-, ( ASP):

Request.ServerVariables("HTTP_X_REWRITE_URL")
+6

Source: https://habr.com/ru/post/1768746/


All Articles