So you have to move your site to a new domain - it happens. One of my clients just had to go through this because of a legal issue. But never fear - there’s no need to break your existing search engine results, or websites that have linked to your old domain, or folks that have bookmarked you, etc. Put these three lines, and only these three lines, into an .htaccess file on the old site (assuming you’re using Apache as your web server):
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^ http://www.new-domain.com%{REQUEST_URI} [L,R=301]
Of course, replace “www.new-domain.com” with your new domain. That’s it. Every request that goes to the old site will be automatically redirected to the new. In case you’re wondering, the “301″ number sends what’s called a “header message” to the search bots that this is a permanent move, and that they should update their records accordingly. This elegantly avoids any duplicate content issues.
Leave a comment