Created
November 27, 2012 09:13
-
-
Save flashtopia/4153268 to your computer and use it in GitHub Desktop.
ASP Redirect Directoy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
'default.asp page for directory you want to redirect out of... | |
'options | |
OldVdir = "oldvdir" | |
NewVdir = "newvdir" | |
'redirect code | |
query_string = request.ServerVariables("QUERY_STRING") | |
if query_string <> "" then | |
query_string = "?" & query_string | |
end if | |
OldURL = "http://" & request.ServerVariables("SERVER_NAME") & request.ServerVariables("URL") & query_string | |
NewURL = replace(OldURL,OldVdir,NewVdir) | |
Response.Status="301 Moved Permanently" | |
Response.AddHeader "Location",NewURL | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment