When you are redeveloping an existing site, you often have to do the development using one URL and then when the site is to go live you need to change the URL. When using WordPress, especially a WordPress Network of sites, it’s important that you follow certain steps, in a particular order, to make sure that the domain is changed in all the necessary places and so you don’t get caught in a loop of redirects.
There are two great posts on how to make this change without any problems:
To change WordPress without a network, http://codex.wordpress.org/Changing_The_Site_URL. I have only used the “Changing the URL directly in the database” method, which appears toward the end of the options listed (before ‘Moving Sites’), because then I know all instances of the URL have been changed, even ones for images and those I may have hand coded into pages, posts, text widgets, etc.
To change WordPress with a network enabled, http://www.wordpress-website.org/2010/12/change-primary-domain-wordpress-multisite-network/. I’ve used this most often as I have a number of clients that use the network feature and this post is very easy to follow and does the trick for me without any problems.
Both of these posts just cover changing the primary domain and URL, NOT moving a site when you are moving actual files. That’s for another day.
A couple bits of advice:
- Be sure to follow each step carefully and in the order given.
- Make sure you have backed up your database. If you depend on your WordPress website, especially if you are a web designer, you should be comfortable with phpMyAdmin. Now that I am it’s made my life so much easier, and less stressful about doing back-ups!