Skip to content

Instantly share code, notes, and snippets.

@brstp
Created Jun 14, 2011
Embed
What would you like to do?
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