Move your Wordpress website to your new domain
October 24th, 2008 by SwaraTech
A friend recently asked me how to move his blog, which is on /blog/ on his domain, to a new domain on it’s own. The steps are easy, but have to be taken in the right order to make sure you’re not annoying your users and the search engines:
- Put up a
robots.txton the new domain with the following contents:User-agent: * Disallow: /
- Copy the database and files to the new domain.
- Edit
wp-config.phpto have the right database settings, and add the following lines, replacing sample.com with the right domain:define('WP_SITEURL', 'http://www.sample.com/'); define('WP_HOME', 'http://www.sample.com/'); - Now set up your blog install, with the same settings as on the old domain (if you have a caching plugin installed, delete your cache files).
- Install the Search and Replace plugin, and do a search and replace for your old URL’s and change them with your new URL’s.
- Once you’re done, and you’ve checked everything works twice:
- Remove the
robots.txtfile. - On your old blog, add the following line to your apache
.htaccessor vhost-config:Redirect 301 /blog/ http://www.newdomain.com/
- Remove the old blog code and database.
- Change your FeedBurner account, if you have one, to pick up the correct feed.
Rate It!
- No Comments »
- Posted in Wordpress

