raptorix

msg:952624 | 12:32 pm on May 14, 2004 (gmt 0) |
Just create a website with a default.asp file with script: response.redirect("http://www.domain.com/") Don't think it matters where the site is hosted.
|
mattglet

msg:952625 | 2:12 pm on May 14, 2004 (gmt 0) |
Response.Redirect() is actually a 302 (Temporary Move). You need to do this for a 301: <% Response.Status = "301 Moved Permanently" Response.AddHeader "Location", "http://www.example.com/yourpage.asp" %> -Matt
|
super_seo

msg:952626 | 4:52 am on May 15, 2004 (gmt 0) |
Not sure if I'm understanding this correctly. --- Just create a website with a default.asp file with script: So i have to change the IP address? Not really viable as the site is in all search engines, a new IP will course alsorts of problems with them? This is the first time i've had to set this up and if the clients website has to start a fresh in the search engines i'm hung, drawn and diced into tiny pieces. Is there no other way i can create this?
|
mattglet

msg:952627 | 4:21 pm on May 15, 2004 (gmt 0) |
No, you don't have to change the IP address. On any page that you want to redirect, put the code I posted above at the very top of the page. replace "example.com/yourpage.asp" with your site/page you want to redirect to. -Matt
|
super_seo

msg:952628 | 4:10 am on May 16, 2004 (gmt 0) |
I think we've lost focus of the original question, or i'm being very stupid. Sorry i am a beginner. I know how to do a redirect in code, i am asking to do a redirect from example.com to www.example.com, at any stage The DNS points both example.com and www.example.com to the same I.P address in IIS. To use this code, as your correctly mention above, i would need to set up a new 'dummy' website in IIS with a new I.P address, so when someone omits the www it will go to this new site and then use the code mentioned to redirect to the correct www site. This as i see it, needs a new I.P address for a 'dummy' website, which i desperatly want to avoid. So can this be done without a 'dummy' website?
|
chrisgarrett

msg:952629 | 4:51 pm on May 16, 2004 (gmt 0) |
Are you wanting to do a redirect if the user or bot goes to whatever.com rather than www.whatever.com? All you need to do is provide an include in every page that checks SERVER_NAME server variable and if it finds no 'www.' does the 301 with the headers mentioned above. Have I understood the problem correctly? Chris
|
super_seo

msg:952630 | 5:08 am on May 17, 2004 (gmt 0) |
Yes that’s what I want to do but unfortunately I’ve got 20,000+ pages on the site. Placing the code on every page isn't really an option. I need universal way of making this happen.
|
chrisgarrett

msg:952631 | 6:45 am on May 17, 2004 (gmt 0) |
If it is a dedicated/co-lo server you can add a new site to IIS and set the host header URL in the settings. Set that site to have a permanent redirect to the www. version. You do not need a new IP for that, they determine which is which via the url the user uses (its a http 1.1 thing). Chris
|
|