js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:
Hi, I have several sites in my old server, I want to retire the old
server. During the DNS change, it will take about 2 days. how can I
redirect the old traffic to the new server, and make sure header
information (i.e. the URL) will get redirected as well so that the new
server will know which application to response to the requests.
Use a customized 404.asp page
select the error string, replace the domain and do a redirect.
Then delete or rename all other root files and all folders
qstr = lcase(Request.ServerVariables("QUERY_STRING"))
will give you in qstr something like:
404;
http://myOldD.org:80/myFolder/myFile.asp?a=12345
so write this vbscript in the 404.asp:
<%
qstr = lcase(Request.ServerVariables("QUERY_STRING"))
qstr = replace(qstr,"404;http://myOldD.org:80","http://NewDomain.org")
response.redirect qstr
%>
not tested
Form posting and old cookies fail of course,
as will capitals in the querystring
in this simple example.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)