As I understand it, you want to change the value of the browser address if the address contains "/home.asp" to "/". For instance:
http:
instead
http:
In the classic asp script, it runs on the server before sending the result to the client, so there is no way to collect the value of the browser address before executing the code, but with javascript, etc. in client scripting languages,
Using Request.ServerVariables with parameters "URL", "PATH_INFO", "PATH_TRANSLATED", etc. it just won’t work, because they must return the name of the “running for a while” script (asp page).
But there is a way to redirect all your old home.asp pages to the new root URL. You can use the invitation request check for the new version of the site. For instance:
If the old address was something like this:
"http://www.sitename.com/home.asp?some=querystring&more=querystring"
Then redirect it to:
"http://www.sitename.com/?ver=2&" & Request.QueryString
In the script, you can check if querystring ("v") = 2 really knows that the address from the new else version redirects it to /? v = 2 no matter what the URL was.
source share