How to move WordPress to a subdomain
February 9, 2008 – 3:29 pmby Jake D
I recently made a WordPress blog for one of our clients. Everything was setup fine in a directory similar to www.thewebsite.com/blog/. Then I decided that I wanted the blog to have its own subdirectory, www.blog.thewebsite.com.
The quick answer: export your data and reinstall WordPress.
The whole story:
So I used the cPanel interface of the web hoster and created a subdomain, blog, and set the document root to /www/blog/. When I would try to pull up www.blog.thewebsite.com , the browser would just redirect to www.thewebsite.com/, and no blog would appear.
I was going to go through all of the things that I did to try to hack-up WordPress so that I would not have to reinstall, but then I realized that none of that actually worked. I could get far enough that the page would show up and about half of the links would work, but there ended up being an issue with the permalinks.
What I had to do was use the Manage->Export feature of the WordPress admin area to save my categories, posts, etc. Then, to uninstall WordPress, I deleted all of the tables in my WordPress database, then ran the install.php script again. I probably could have kept the users table, and perhaps a few other tables with the plugin settings, but I didn’t. So I had to reactivate my plugins and all of the other options that I had changed from the default values.
If you have a better fix for this, please leave a comment!




One Response to “How to move WordPress to a subdomain”
We just released a plugin which fixes the permalink issues which users often have after a move. It also updates urls that you might have used for linking within your posts.
Check it out at: http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/