Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > redirect to new server?

Reply
Thread Tools

redirect to new server?

 
 
js
Guest
Posts: n/a
 
      09-27-2004
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.





 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      09-27-2004
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)

 
Reply With Quote
 
 
 
 
js
Guest
Posts: n/a
 
      09-27-2004
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
> <%
> qstr = lcase(Request.ServerVariables("QUERY_STRING"))
> qstr = replace(qstr,"404;http://myOldD.org:80","http://NewDomain.org")
> response.redirect qstr
> %>
>



 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      09-27-2004
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 ;-}


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

 
Reply With Quote
 
js
Guest
Posts: n/a
 
      09-27-2004
Thanks Evertjan.
"Evertjan." wrote :
> 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.


How to force to hit 404 page?



 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      09-27-2004
js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:

> Thanks Evertjan.
> "Evertjan." wrote :
>> 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.

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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

 
Reply With Quote
 
js
Guest
Posts: n/a
 
      09-27-2004
Thanks Evertjan.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Response.redirect does not redirect from .aspx page =?Utf-8?B?VHJveQ==?= ASP .Net 3 10-15-2008 09:07 PM
Javascript new-new-new-new-newbee weblinkunlimited@gmail.com Javascript 2 03-11-2008 01:15 AM
Redirect to secure FTP site via response.redirect Ron Howard ASP General 2 08-11-2004 07:40 PM
Basic Q - Response.Redirect, all redirect to first Response.Redirect statement Sal ASP .Net Web Controls 1 05-15-2004 03:46 PM
Response.Redirect to a new browser window? Jules Lucas ASP .Net 2 08-08-2003 05:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57