I recently moved my entire Wordpress site from http://davidchiu.net to http://davidchiu.com. I would have started with DavidChiu.com, but to my surprise another David Chiu had purchased the domain in the mid-90s (up until then, I had this naive notion that I was the only David Chiu in the world). In 2004 I was able to acquire the .COM version of my domain. So today I decided I would bite the bullet and move my site over to davidchiu.com. I’d still keep davidchiu.net, but make davidchiu.com my main site. It should be easy right? In this very rare instance, it actually was.
First I needed to move Wordpress over to the new domain. Since both domains reside on the same server, this was fairly trivial. From the davidchiu.com site root I just copied over the entire site from the davidchiu.net site root:
[davidchiu@vps public_html]$ cp -R ../../davidchiu.net/public_html/* .
Then I edited the .htaccess file to add SEO friendly 301 redirects from davidchiu.net to davidchiu.com:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://davidchiu.com/$1 [L,R=301]
</IfModule>
I actually kept some of the htaccess rewrite conditions from Wordpress and changed the rewrite rule. The reason why I did this is so that any old links to davidchiu.net would be correctly redirected to davidchiu.com but if I decide to put new files on davidchiu.net, I will be able to access those new files.
The last thing I needed to do is re-configure Wordpress. First I had to login to the old Wordpress admin http://davidchiu.net/wp-login.php, go to “Settings”, and change the Wordpress URL and Blog URL to the new domain – http://davidchiu.com:

Once the settings are saved, Wordpress redirects me to the new domain Wordpress login. And I’m finished! Now the site has been migrated over to the new domain and it took me longer to write this post than to do the actual work
!