It has been a week or so since I posted.  I have been somewhat busy actually working on SEO for my clients, however I did run across an issue that I wanted to address here that I thought would be useful.

What happens when you decide that you need a new domain for your website?  Perhaps your website has been penalized (shame shame).  Or, perhaps you realized that your domain could be better if it had a few more keywords.  Whatever the reason, if you decide to just scrap your current domain and start another, you need to do it right or you will shoot yourself in the foot for SEO.  The reason for this is because the search engines have all of your pages indexed with a certain domain name.  Not only that, but all of the links to your site are (you guessed it) using your domain.  You don’t have to start over however.  There is a way to move your entire site without skipping a beat.

The way to do this is with 301 Redirects.  A 301 Redirect is a protocol used to tell the browser (and search engine spiders) that your site has been permanently moved to a new location.  This protocol is set in your .htaccess file.

For those who don’t know, the .htaccess file basically controls everything that happens with your server.  Before loading your website, the browser will look at the .htaccess file first to determine if it needs to do anything special – like redirecting your website.  301 Redirect aren’t the only functions of the .htaccess file.  For a full tutorial, view this .htaccess tutorial.

The code I am going to give you below needs to be inserted into the .htaccess file, which is usually in the root of your website files.  If you don’t have one, you can easily create one by using your favorite HTML editor (my favorite is Notepad++).

Moving Your Entire Website from One Domain to Another

Copy the following code into your .htaccess file and change the domains.

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^olddomain\.com
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=permanent,L]

RewriteCond %{HTTP_HOST} ^www.olddomain\.com
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=permanent,L]

What this code does is redirects both instances of your old domain (from www and non-www) to the new domain.  Once this code is uploaded to your server, your site will be moved in its entirety.  For example, if you have www.olddomain.com/FAQs, it will redirect to www.newdomain.com/FAQs.

How to Redirect Individual Pages from One Site to Another

Sometimes you don’t need to just redirect the entire site, but individual pages.  I recently did this for a client who had built their website originally with really poor not SEO friendly URLs.  Their new site (because of me) had great keyword rich URLs.  If this is your situation, you will need to redirect your pages individually, however there also is a function to redirect entire folders to a single page.

Here is how to do this in your .htaccess file.

Start by turning your Rewrite Engine on with this code

Options +FollowSymLinks
RewriteEngine on

In order to move a single page, use the following:

redirect 301 /oldunfriendlyurl.html http://www.newdomain.com/very-friendly-url/

You will need to do this for each page.  However, if you don’t have a want to redirect an entire folder to a specific page, use this code:

redirectMatch 301 /oldfolder/ http://www.newdomain.com/newfolder/

With this code, any URL inside of /oldfolder will automatically be redirected.

Changing Your Domain with Google

Finally, you need to tell Google that your old domain is no longer in use and you want your search results to load your new domain.  Luckily for us, Google Webmaster Tools has a built in feature to do this for us.

  1. Create a Google Account and visit http://www.google.com/webmasters/tools.
  2. You need to verify both domain names with Google Webmaster Tools (this will be easier if you don’t setup the 301 redirects yet).
  3. Open up the Webmaster Tools for the old domain.  Click on Site Configuration and then on Change of Address.  From here, you will be able to select from a drop down list your new domain name in order to initiate the change.

This process might take a few days, but once it is complete, Google will now have your site pulling the the correct results and showing your domain name.

  • Digg
  • del.icio.us
  • Facebook
  • blogtercimlap
  • Fark
  • Google Bookmarks
  • Mixx
  • MySpace
  • Sphinn
  • StumbleUpon
  • Technorati
  • Twitter