redirect to new server?

J

js

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.

Thanks in advance.
 
E

Evertjan.

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.
 
J

js

Thanks Evertjan.

The customized 404.asp is not related to the IIS's 404 page, Right?



Since domain names are still the same (during DNS change, only IPs got
change). I can't do a replacement. Can I do this: Put the IPs mapping in a
host file. And redirect like this:

<%
qstr = lcase(Request.ServerVariables("QUERY_STRING"))
response.redirect qstr
%>




customized 404.asp
 
E

Evertjan.

js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:
The customized 404.asp is not related to the IIS's 404 page, Right?

I think it is an IIS setting to lok for the custom page.
Since domain names are still the same (during DNS change, only IPs got
change). I can't do a replacement.

Yes, I see.

But than you can use the IP:

qstr = replace(qstr,"404;http://myOldD.org:80","http://123.456.654.321")

Can I do this: Put the IPs mapping
in a host file. And redirect like this:

<%
qstr = lcase(Request.ServerVariables("QUERY_STRING"))
response.redirect qstr
%>

Only in the 404.asp does the "QUERY_STRING" contain the url!

And even then:

Put the code in for every individual file ??

Good luck ;-}
 
J

js

Thanks Evertjan.
"Evertjan." wrote :
js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:


I think it is an IIS setting to lok for the custom page.

How to force to hit 404 page?
 
E

Evertjan.

js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:
Thanks Evertjan.
"Evertjan." wrote :

How to force to hit 404 page?

Any nonexisting page will be redirected to the 404 page.

So as I said:

rename [or delete] your root folders and all the root files but the
404.asp, so no user can find an existing file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top