Forum Moderators: phranque
Forgive me if this has been addressed, I see many topics on 301 redirects, but none addressing a situation where someone moves an entire site to a new domain..
Has anyone successfully moved a site to a new domain, redirected traffic coming into the old domain's pages to the corresponding page on the new domain, while preserving their search engine rankings?
The old domain is hosted on a Linux server and we do have access to the .htaccess file. Can anyone direct me to a discussion or article about this?
Any help is greatly appreciated!
[olddomain.com...]
gets redirected to: [newdomain...]
If there is some code or script that can used to do this for all pages, without having to make an entry for each individual page in the .htaccess file, this would be what I'm after.
From everything I've read, there is no shortcut, but thought I'd check with you guys to be sure before I type out almost 1000 entries in our .htaccess file :)
Redirect 301 / http://www.example.com/
Jim
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) [newdomain.com...] [R=301,L]
And it works just the way it should :)
I assume that this is equivalent to the above suggestion...
However, in the 2 weeks that we've had the 301 redirect in place, our olddomain.com URLs have fallen to 2nd and 3rd pages (sometimes lower) in Google on searches that we previously appeared at or near the top. These old URLs haven't yet been replaced with the newdomain.com URLs that we are redirecting the olddomain.com traffic to. Our 'free traffic' is down sharply during this time.
Is this normal? Has anyone else that has changed website domains experienced something similar?
Thanks,
g1tech
Can someone verify the code that we used is correct?
------------------
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) [newdomain.com...] [R=301,L]
------------------
It forwards incoming traffic from www.olddomain.com/anypage.htm to www.newdomain.com/anypage.htm perfectly, but Google and Yahoo haven't updated their index with www.newdomain.com yet. Meanwhile our SERP's on G and Y continue to drop.
Maybe the answer is simply more patience..
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{HTTP_HOST} !^www\.newdomain\.com
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
As with any change to your server configuration, I strongly suggest that you use something like the "Live HTTP Headers" extension to Firefox to carefully check the server response headers sent by your server. You should see one and only one 301-Moved Permanently response when requesting any page on "olddomain.com".
Jim
-----------------------
[olddomain.com...]
GET /anypage.htm HTTP/1.1
Host: www.olddomain.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070216 Firefox/1.5.0.10
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: __utma=103541569.1270042340.1156519102.1165820082.1167790803.17; www%2Epro%2FCustomerID=1
HTTP/1.x 301 Moved Permanently
Date: Wed, 07 Mar 2007 20:50:30 GMT
Server: Apache/1.3.33 (Unix)
Location: [newdomain.com...]
Keep-Alive: timeout=2, max=199
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1