Skip to content

Instantly share code, notes, and snippets.

@brstp
Created June 14, 2011 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brstp/1024514 to your computer and use it in GitHub Desktop.
Save brstp/1024514 to your computer and use it in GitHub Desktop.
A custom 404 error page for IIS with redirection of changed urls. http://www.lumano.se/Artiklar/OmdirigeraNarDuFlyttarSidan
<%
option explicit
Response.Buffer = true
dim sServerName
dim sURL
sServerName = lcase(Request.ServerVariables("SERVER_NAME"))
select case sServerName
case "www.oldgreenplus.com": sURL = "http://www.new-site.com/template/Page____8466.aspx"
case "www.oldgreen.com": sURL = "http://www.new-site.com/template/Page____8466.aspx"
case "www.oldbrown.com": sURL = "http://www.new-site.com/template/Page____7320.aspx"
case "www.olddecor.com": sURL = "http://www.new-site.com/template/Page____7319.aspx"
case "www.old-e.com": sURL = "http://www.new-site.com/template/Page____7818.aspx"
case "www.oldcopper.com": sURL = "http://www.new-site.com/default____6763.aspx"
case "oldcopper.com": sURL = "http://www.new-site.com/default____6763.aspx"
case "www.oldtechnology.com": sURL = "http://www.new-site.com/default____6764.aspx"
case "oldtechnology.com": sURL = "http://www.new-site.com/default____6764.aspx"
case else sURL = "http://www.new-site.com"
end select
Response.Status = "301 Moved Permanently"
Response.addheader "Location", sURL
Response.End
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment