Forum Moderators: open

Message Too Old, No Replies

IIS Redirect

How to redirect one website to another, by using asp, so that every request

         

lucib23

10:27 am on Sep 8, 2003 (gmt 0)

10+ Year Member



Hello to you all.

I use IIS 5, installed by default.
I tried to redirect a site to another, by using asp, so that every request to that website will be redirected to the new one.

I.E. [site1:port...] will be redirected into [site2:port...] Only the name of the site changes.

i wrote a file called 404.asp, that used Response.Redirect to redirect the browser and changed the default response of the web site, so that when a file is accessed, the 404.asp will be executed. Somehow, this doesn't works.
Now i use an compromise solution. I use an 404.html file,
which redirects the browser to the new site.
The limitation is that i can redirect the browser only to the root of the new site.

Anyone has an ideea?
Thanks,
LuciB23

bateman_ap

10:55 am on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In your custom error pages how have you referenced your custom 404 page?

You have to use a relative url, not a file as it seems not to run the asp code if you do it like this.

woop01

11:08 am on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you trying to redirect an entire site like sending www.thissite.com to www.thatsite.com? If so, try this…

1.Create a new site on the server for www.thissite.com
2.Go into the server admin interface for www.thissite.com (right-click my computer and select manage then Tree/Service and Applications/Internet Information Service/www.thissite.com)
3.Right click on www.thissite.com and select properties
4.Under Home Directory chose redirect to another URL
5.Type in www.thatsite.com

If you don’t have server access, this obviously won’t work.

lucib23

3:38 pm on Sep 8, 2003 (gmt 0)

10+ Year Member



Thank you all.
bateman_ap : I used a link to a file, not URL. Now it works. Thanks.
woop01: I tried this also, and it works. Much better solution than my 404.asp, allthough this is more customisable. Thanks.

Lucib23