Status
Not open for further replies.

andywozhere

Member
A client is changing their domain name due to rebranding. I'm figuring I just need to pop some code in the .ht access file and hey presto robots will find us at the new site, right? Or am I missing something?

Here's the code I'm thinking of using:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)theoldsite.com[NC]
RewriteRule ^(.*)$ http://thenewsite.com/$1 [R=301,L]

I know I could use Google Webmaster to redirect robots to the new URL... but it has never been set up for the old site and I don't figure there would be too much point as the move is tomorrow.
 

Satanta

New Member
Or am I missing something?
Assuming both domains resolve to the same DocumentRoot directory (hence the requirement for the 'host' filter), as BK says it looks good.

No harm ensuring the client is aware that it may take some time for the full effects to kick in (in terms of transfer of previous rankings etc.) and they may/will experience some turbulence in SERPs as a result, all too common for people to assume it'll be an overnight effect with no dips or kinks.
 

andywozhere

Member
Yikes, the old site is using Zeus... here's what I hope to be the correct new code

Code:
#— 301 Redirect —

match URL into $ with ^/$
if matched
set OUT:Location = [url]http://www.newsite.com/[/url]
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif
 

link8r

New Member
Looks good.

You should set it up in Webmasters as well - it does help with Google dropping the old domain in favour of the new one. You can also track which backlinks survived :)
 

andywozhere

Member
Looks like the Zeus code is only actually redirecting the homepage. I'm getting a 404 "Page not Found" on other pages. I'm finding the Zeus documentation to be pretty well unreadable. Don't suppose anyone might be able to improve this code to include then entire site?

Code:
#— 301 Redirect —

match URL into $ with ^/$
if matched
set OUT:Location = [replacer_a]
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif
 

andywozhere

Member
Here's the code I used in the end:

Code:
match IN:Host into % with ^theoldsite.com
if matched then
set OUT:Location=http://thenewsite.com/
set RESPONSE=301
set BODY=Moved Permanently
endif
 

Drang3d

New Member
I'd agree with Link8r about setting it up in Google Webmasters to help notify about the change. If you had more time I would have started building links to the new domain before doing the switch. Also contact anybody who currently links to the old domain and get them to update their links to the new domain, it'll help get your rankings back quicker
 
Status
Not open for further replies.
Top