How To Move Your Website with 301 Redirects and Google
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 onRewriteCond %{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.
- Create a Google Account and visit http://www.google.com/webmasters/tools.
- You need to verify both domain names with Google Webmaster Tools (this will be easier if you don’t setup the 301 redirects yet).
- 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.

October 16th, 2009 at 12:55 pm
Nice! Thanks for the tutorial. I’ve been worried about maintaining my Goog status if I change domain names…
October 16th, 2009 at 1:29 pm
[...] more: How To Move Your Website with 301 Redirects and Google Tagged as: current, reason, seo, shame-shame, somewhat-busy, working-on-seo, your-current, [...]
November 16th, 2009 at 4:08 pm
Great article and site! gonna start reading your posts
thanks
November 28th, 2009 at 5:25 am
Hi there, I just stumbled upon this site whilst I’m hunting around the Internet as I’m seeking some info on engine lifts!. It’s a very interesting blog so I’ve bookmarked this site and I will revisit another day to enjoy a proper browse when I have more time.
November 28th, 2009 at 8:10 am
Just bookmarked your blog. Always interested in reading about this particular subject. Bye, Cooper Kinnie ~ Flyttst
January 15th, 2010 at 11:41 am
Redirect 301 / http.://.com/ – This form is also correct I think. I’m not a techie though but i used it once.
January 16th, 2010 at 12:12 pm
Nice blog adding this to my twitter now
January 29th, 2010 at 3:15 pm
Great post..Keep them coming
I love your site and marketing strategy. Check out my website if you get a chance, just click on name. Thanks for sharing.
February 10th, 2010 at 12:16 pm
Thank you for you post, i was thinking about you the other day. I need some time to think about this
Follow me on Twitter
February 16th, 2010 at 11:48 am
Greetings,
I have the same issue…I am launching a complete redesign of my existing site, and am looking for the best way to approach the 301 nightmare. So how would I do what you are suggesting, but with 15,000 pages? Each page should be mapped to the new page I suspect, but wouldn’t an htaccess file blow up with 15,000 entries? There is no easy 1 to one formula with wildcards either…I could create a db with the mapping, but not sure how I would implement it as part of the 301 plan.
Any ideas out there?
February 27th, 2010 at 3:06 pm
Thank you for a well written article! I think this is a good resource for individuals looking for good names. I also recommend http://www.squadhelp.com for finding great domain names. This site has a great naming community, allowing users across the world to submit domain name suggestions. The best suggestion wins a prize that is setup in advance by the contest holder, creating a win win situation for every one.Contests start at $35 and users typically receive 200+ good name suggestions within 2 days. Just thought your readers might find it interesting!
March 5th, 2010 at 8:00 pm
Your RSS feed is not work in my browser (google chrome) how can I repair it?
March 6th, 2010 at 3:29 am
Blogs RSS feed is not work in my browser (google chrome) how can I repair it?
March 8th, 2010 at 5:56 am
People who aren’t using twitter will have either not figure out the major power of twitter or they might not be aware of its existence. Doing some research, you can get to know the positive and successful stories of twitter and their role in driving traffic towards your business