Recently I was faced with a rather intriguing problem I hadn’t come across before – moving an entire website (indexed by Google etc.) to a completely new domain.
The website was hosted by myself but the domain was owned by another affiliate (pointing at my nameservers on a revenue share basis).
Upon informing myself that he no longer wanted to work on a revenue share basis [in order to focus solely on his own projects] I enquired if he objected to me buying my own domain and continuing with the site alone…..
He gave me the green light and so the move was on!
The first thing that crossed my mind was how to salvage some of the hard work that had already been put into the website (backlinks, page rank, serps etc.) over the past few months.
Simply moving the site to a new domain was not an option – Google would still have the previous site indexed and would view the new site as duplicate content (plus any SEO juice that has been built up would simply be lost).
MOVE BABY MOVE
The first thing to do is set up your ‘new’ website.
Buy the domain, setup your hosting and copy the website you would like to move to the new site.
Note I said copy – do not delete the existing website!
You basically want two identical websites on both the old and new domains (if your existing site has a database then you will need to recreate this on your new site also – remembering to change the new sites configuration to point at the new DB).
Now – upload the following robots.txt file to the root of the new site to stop anything from being able to spider or crawl it (as there are no links to the new site currently the chances of this happening are virtually nil – but better to be safe than sorry!)
User-agent: * Disallow: /
Cool – so we now have two identical websites sitting on two different domains with one blocked from Google and other spiders. Excellent.
Next we need to ensure BOTH sites have Google Webmaster Tools installed. To do this we simply head to http://www.google.com/webmasters/ and sign in using our normal Google Account (sign up if you don’t have one)
If the old site does not have Webmaster Tools setup then set it up now – click “Add a Site”, enter the url of the old website and then follow the instructions to verify it.
Make sure you do this for both domain.com and www.domain.com versions of the site (Yes – Google treats them as different sites!)
Now do the same for the new website too.
Great – we now have Webmaster Tools installed and Google now knows we own BOTH websites. This is veryimportant.
TEST THE NEW SITE BABY
Now it’s time to test test test!
Test the new site and make sure everything is working correctly (no 404s, all inks work etc).
Because we copied it directly from the old site the structure should be exactly the same. This will make setting up the 301 redirects in the next step simple.
Once you are happy everything is hunky dory – it is time to put the redirects in place and tell Google we have moved.
We now need a way to redirect all traffic from our old website to our new website. And we can do this easily enough with a simple rewrite rule.
RewriteEngine on RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
The ’301′ at the end of the line tells Google (or whatever crawler / search engine is following it) that this is a permanent redirect.
the code above should be saved in a file called .htaccess (leading full stop and no file extension) and uploaded to the root of the old website – remembering of course to change www.newdomain.com to be the domain of your new website.
This redirects any traffic to the old domain to the corresponding url on the new domain.
Would redirect to:
Note: The fact the structure of the website is exactly the same (just the domain changing) means the redirect was easy as pie – if we were to change the structure of the new site however then we would obviously need to map everything up correctly – to ensure users (and search engines) were being sent to the correct page.
Once everyting is in place hit a page on the old site – are you being directed to the corresponding page on the new website?
Let’s move on.
TELL GOOGLE WE HAVE MOVED
So now we move onto the bit that isn’t common knowledge (or at least it wasn’t to me anyway) – telling google that the site has moved and request a domain name change.
Log back into Webmaster Tools, find your old website in the list and double click it.
Select ‘Site Configuration‘ from the left hand menu and then choose ‘Change of Address‘.
On this page you will see a brief of overview of the steps we have already completed followed by a drop down list to choose a new domain for this website.
In the drop down you should find the new website we set up earlier (we verified it earlier with Webmaster Tools remember?)
Select the new domain from the drop down and hit submit.
The page will refresh and you will be presented with a message informing you that www.olddomain.com has been moved to www.newdomain.com.
IMPORTANT: Now head to your new website and remove the robots.txt file we created earlier – this will allow Google to update its index with your new site – replacing your old site in the process.
And that is about that. Simple.
I did this myself just a few weeks back and have seen only a slight impact on my sites traffic and revenue. Within just one week over 22,000 pages from the new site were indexed and ranking well within Google.
Just remember to keep the 301 redirects in place on the old site for aslong as possible (permanently if possible) and to let anyone who links to the old site know that it has moved – so that they can update their links and bookmarks.
If you have any feedback, thoughts or improvments to anything outlined above please feel free to leave your thoughts below.