Redirecting a wordpress blog to a new domain is a simple task of creating a .htaccess file using notepad and uploading it to the root of your server.
Simple though it is, I remember spending almost the entire day trying to find the right solution when I decided to do this some time ago. It was clear from the articles I read that using a 301 (permanent redirect) rather than a 302 (temporary redirect) was the way to go if I wanted to maintain traffic from both the old blog to the new blog and maintain the incoming links. SEO wise, you just need to know that using a 301 redirect is the way to go.
So, here are the steps I took to redirect the posts, pages, comments and categories from one blog to another blog. I haven’t mentioned the blog names since one of them no longer exists. The post is still however very relevant.
- The VERY first thing you want to do if you use the method I’m using to is ensure you DON’T allow search engine traffic to your old blog until the new one has been redirected.
Yes, it could take time for the search engines to notice you have two identical blogs with identical content, but simply going to “Settings” > “Reading” in the dashboard and selecting the checking the box next to Search Engine Visibility that says “Discourage search engines from indexing this site,” you will be confident that you can avoid having to justify your actions to the likes of Google if they slap you for duplicate content.
- In terms of moving the blog, the first thing I did was backed up ALL my files and transferred them over to the new domain, using FTP software. I use Filezilla since it’s no frills and simple.
Now, trying to move the database from one blog to another blog is NOT the easiest thing in the world to do and I cheated! I exported the XML file of the old blog by going to “Tools” and then “Export” within the WordPress dashboard and then, I used phpMyAdmin within the control panel of the new blog to import the xml file. This imports all of my posts, pages, comments and categories but, it doesn’t import my password, widgets etc. If you use the WordPress import feature under Tools, it will include passwords, widgets etc. So, you have to decide which is most beneficial to you. My suggestion is that you copy and paste your widget content into a text file and save them anyway. I always do this even when backing up a clients siteand it’s good practice.
Though a few years old, here is a post you might find helpful if you decide you want to move the entire database:
- The next step in moving my site to a new domain name was to either create a .htaccess file or, in my case, modify one I already had. This is what my .htaccess file looked like and you can copy this and add your own domain name where it says “yourdomainname.com”:
# BEGIN WordPress
RewriteRule (.*) http://www.yourdomainname.com/$1 [R=301,L]
# END WordPress
- Now you want to upload the .htaccess file to the “ROOT” of the server of the old blog. By “ROOT” I mean the same folder where your index.php file sits which is usually inside the public_html folder.
Now all of your links and the traffic that currently went to your old blog, will be redirected to your new blog. Be a little patient though, the pages have to be cached and you might notice broken links and 404 pages for the first few minutes at least.
Now, use this site to be sure your blog is being redirected as it should be: http://www.webconfs.com/redirect-check.php
Hope this helps you,