473,511 Members | 16,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

redirect to new server?

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.

Jul 19 '05 #1
6 1306
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)

Jul 19 '05 #2
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
<%
qstr = lcase(Request.ServerVariables("QUERY_STRING"))
qstr = replace(qstr,"404;http://myOldD.org:80","http://NewDomain.org")
response.redirect qstr
%>

Jul 19 '05 #3
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)

Jul 19 '05 #4
js
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?

Jul 19 '05 #5
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)

Jul 19 '05 #6
js
Thanks Evertjan.
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3815
by: JDJones | last post by:
We are trying to set up a PHP page to handle server requests for individual web pages that we are moving to a new server. The part that complicates this procedure is that the files will not be...
3
3887
by: Paul | last post by:
I'm not getting the results I want when I use Response.Redirct in a ASP page. I enter this line of code in a asp page from domain1.com. Response.Redirect...
2
7780
by: Robert Gordon | last post by:
I now realize I probably should have tried posting this on the IIS board first.. I am running OWA 2003 Server as Front End server to my Exchange 2000 native domain. The FE server is secured by...
6
4546
by: \A_Michigan_User\ | last post by:
Ok, I give up... why do 1-4 work fine... but 5-6 give "can't find" errors? 1. Client-side VBscript code: call navigate("\\209.11.22.33\MyDir") 2. Client-side VBscript code: location.href...
3
9059
by: Justin | last post by:
Hi, Im confused here over the usage of Response.Redirect and Server.Transfer. I used frameset for my work, what are the proper usages of the two methods that seems working similar.. The...
3
5481
by: Alan Silver | last post by:
Hello, Sorry if this is a stupid question, but I can't really see much difference between these tow methods according to the scant info in the SDK. Could anyone enlighten me? TIA -- Alan...
15
6367
by: KBuser | last post by:
I recently developed an internal website with various queries against our SQL server. I added buttons with Response.Redirect. These buttons do not work with Internet Explorer, however when using...
10
13391
by: Bill | last post by:
In file FIRST.ASP, I've got <% Response.Redirect "SECOND.ASP" %> The redirect is happening, and I'm seeing the content from SECOND.ASP in the browser, but the URL in the browser is still...
4
11388
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
9
4330
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7355
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5066
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.