get current url of the page (used URL Rewrite)

asp-classic, vbscript

Solution

You can try to output all ServerVariables like so:

for each key in Request.Servervariables
  Response.Write key & " = " & Request.Servervariables(key) & "<br>"
next

Maybe the URL you seek is already there. We use the Rewrite module and there is a ServerVariable called `HTTP_X_ORIGINAL_URL` that contains the rewritten URL path, e.g. "/home/page" in your example.

Protocol (`HTTPS=ON/OFF`) and Server (`SERVER_NAME`) can also be found in the ServerVariables.

Problem

I am working on classic asp application. I have use URL rewrite on some pages. How can i get current url of the page in classic asp? Example: http://www.site.com/page.asp ---> url rewrite in IIS ---> http://www.site.com/home/page so here i want current url of the page which is http://www.site.com/home/page Please help me. Thanks.

Original source