(.htaccess) Change Your Domain, Save Incoming Links!

As everyone has most likely experienced at some point, changing domains and saving your incoming links is always looked to as a nightmare and major loss of traffic with dead links, but with .htaccess it is a easy as 1 – 2 – 3.

You will need to edit/add a htaccess file to your root of your web hosting account (Usually your “public_html” folder) and add the following lines:

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

There is a couple key points in the above:

  1. You will need to have “Mod_Rewrite” on your web server and activated in Apache
  2. You will need to fill in YOUR domain information, replacing old and new domains (In Bold)
  3. [R=301,L] – This is one of the most important parts, it tells any incoming search engines that the page has permanantly moved and it needs to update its links.

Using the above will allow you to change over to a new domain for your web site without losing any traffic and having issues with deadlinks. You will need to keep your old domain attached to the same web hosting account for a little while, to give everyone a chance to change to your new domain.

This will not work if you just up and move to a new domain, you will need to keep the old for atleast a month or so while all search engines and incoming link sites get updated.

Join the forum discussion on this post - (1) Posts

Leave a Reply