
- Image via Wikipedia
We’ve been getting up close and personal with WordPress MU for a while now here at Gazette Communications. To say the least – it has been nice, and painful. We tested the product for use on one of our two flag ship products for about a month and then went to use it and ran into a bit of a brick wall.
WordPress MU doesn’t support multiple domain names out of the virtual box. Yup, just sub-domains or domain.com/foldername. I think we over looked that part in the “testing phase”.
Luckly – we did some searching and our intern at the time (Chaz Beck) found a post by a guy who had accomplished the same task – here is a rundown of what we did to ge tit working. Not for the faint at heart – and by all means, please make a backup before you try.
For setting up the multiple domains under one WordPress MU installation, credit must be given to Richard Bui @ http://bui4ever.com/ for his excellent step by step guide. His guide helped create these instructions.
Warning: Manual database manipulation ahead.
Prerequisites
Sub-Domains, Not Sub-Directories.
You need Subdomains being used instead of subdirectories for WordPress MU (We tried to use subdirectories but the login ability failed).
To turn on subdomains go to: http://welcome.totheinter.net/2009/05/06/changing-wordpress-mu-from-subdomains-to-subdirectories/ for instructions.
The main thing is setting:
define(‘VHOST’, ‘yes’);
->inside wp-config.php – this will make the switch from sub-directories to sub-domains
Domain Names:
It is assumed that you have setup the domains that are to be used, Richard Bui has some instructions on some of this [steps 1-11].The Steps
- Create the blogs that you want use if you haven’t done so already (Site Admin >Blogs > Add Blog).
- Access your database that WordPress MU uses through PhpMyAdmin (or other tool).
- Navigate to wp_#_option where # is the id for the blog you want to use with a different domain (hint: the siteurl in the table will say the name of the blog).
- Change the siteurl, home, and fileupload url to your new domain, for the fileupload url keep the /file at the end of the url. Also make sure you put a forward slash (/) at the end of siteurl and home.
- Navigate to wp_blogs, click on the domain you are changing. Edit the blogs you are switching to a domain. Put in the following changes:
- site_id = blog_id
- domain = yournewdomain.com
- path = /
Write down the blog_id for later use
- Navigate to wp_sitemeta, copy the meta_value for site_admins meta_key. The stuff you need to copy looks something like this:a:1:{i:0;s:5:”admin”;}
- Inside the wp_sitemeta table, copy the meta_value for illegal_names.
- Navigate back to wp_sitemeta and go to the last page, copy the last meta_id value
- Insert a new entry into the wp_sitemeta table with these values:
- meta_id = step 8’s value + 1
- site_id = step 5’s value
- meta_key = site_admins
- meta_value = step 6’s value
- Insert a new entryinto wp_sitemeta table with these values:
- meta_id = step 8’s value +
- site_id = step 5’s value
- meta_key = yournewdomain.com
- meta_value = NULL
- Insert a new entryinto wp_sitemeta table with these values:
- meta_id = step 8’s value + 3
- site_id = step 5’s value
- meta_key = illegal_names
- meta_value = step 7’s value
- Go to your new domain to test out if the site worked
- Test out the wp-admin of the new domain.Example, http://yournewdomain.com/wp-admin/ <- notice the forward slash at the end, this is important to include otherwise your database won’t be populated correctly (first time accessing wp-admin only, after that you can forget about the last forward slash)
- Look at the wp_sitemeta table and make sure a bunch of new entries were created in the database, this means everything worked.
- Lastly, update your database with the url of the new domain:
- UPDATE wp_#_posts SET guid = REPLACE (
guid,
‘http://exampleoldsiteurl.com’,
‘http://examplenewsiteurl.com’;|
and
UPDATE wp_#_posts SET post_content = REPLACE (
post_content,
‘http://oldsiteurl.com’,
‘http:// newsiteurl.com’;Where # is the blog_id value from step 5
Again – this is not for the faint at heart, or one that is scare of manually manipulating the database. But I will tell you we have three different domain names running all under one install of MU. So – that is a real time saver.
References:
http://bui4ever.com/2007/06/wordpress_mu_with_domain_mapping/
http://bavatuesdays.com/multiple-domains-on-wpmu-mission-accomplished/
http://welcome.totheinter.net/2009/05/06/changing-wordpress-mu-from-subdomains-to-subdirectories/
http://codex.wordpress.org/Changing_The_Site_URL#Domain_Name_Change
Related articles by Zemanta
- WordPress and WordPress MU to Merge (technosailor.com)
- WordPress And WordPress MU Will Merge: Good Or Bad? (blogherald.com)




Posted in
Tags:
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=d97dd253-246b-4d1d-8a4c-d8a69e8c67ce)



