• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

Redirecting whole site with 301 to new domain

Status
Not open for further replies.
Joined
Dec 5, 2005
Posts
1,063
Reaction score
8
I have to move an entire site (2000+pages) over to a new domain as i sold the one the site is on! It was only a month old anyway, so no PR yet, but gg has indexed about 500 of the pages and y! has some too. I have read many bad things about redirecting site-wide using 301's, but it still seems the best option.

Any recommendations from experience? And any ideas on the htaccess code for a site-wide 301?
 
redirects

murph said:
And any ideas on the htaccess code for a site-wide 301?

Try this .htaccess redirect code:

Options +FollowSymLinks

RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www.)?olddomain.com [NC]

RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
 
Thanks. Is the '?' supposed to be there before the domain name and after the www on line 3?
 
Ok cool, just tried it and it works. :) htaccess code is strange at the best of times!
Admin, do you have any idea how long you leave it before pulling the plug on the old domain? I mean after it has been crawled via the 301 by gg etc...
 
Status
Not open for further replies.
Top Bottom