WordPress 3.0 Multisite With Multiple Domains Setup

WordPress 3.0 multisites lets you easily publish multiple sites, on multiple domains, within one installation.  This is a time-saving option for those of us who need to manage multiple separate domains running WordPress, but it does take a little knowledge and file access to set up, and at the moment isn’t for anyone who doesn’t consider themselves technically proficient.

Editor’s Note: Please note that for many users the excellent WordPress MU Domain Mapping Plugin is going to be a better solution. Our solution is really for expert users only.

You will need to be able to modify your vhosts file in order to do this, but once done you will have a very flexible and powerful server.

This article is written for 3.0 alpha, as of the current build on 19th March 2010.

Multi sites mode

  1. Install WordPress 3.0 and install as a normal WordPress.
  2. Add define(‘WP_ALLOW_MULTISITE’, true); near the top of wp-config.php
  3. Log into the admin go to the tools/Nertwork menu.
  4. If it asks you to deactivate all plug-ins do so otherwise go straight ahead and set up multi sites as sub-domains and fill in the other details as needed as needed.
  5. Make a note of the changes needed to wp-config.php and .htaccess and make the changes.
  6. You should now be in multi-site mode.

Adding a new domain

  1. Now we’re in multisite mode login as admin go to super admin/sites
  2. Add a new site – the address can be anything you like just make it unique and make it something you can remember so we can find it easier in the db.
  3. Make sure your domain is pointing at the server if not do so and wait for it to propagate.
  4. Add Vhost alias to the root domain. So if in the Vhost file you have ServerName mywordpres3root.com you would add ServerAlias mynewwordpress.com beneath it.  Alternatively, you can use a wildcard here, but in our implementations there are good reasons why we prefer to specify the host aliases.
  5. Open up the db for editing and add a new row to wp_site table
    1. site_id, domain and path.
      1. site_id, will be a new unique id, remember it
      2. domain, should be set to the new domain name added above.
      3. path should be /
  6. Change the row in wp_blogs that matches your new site and make a note of the blog_id.
    1. Change site_id to the new site_id created above.
    2. Change domain to our new domain name.
  7. Open up wp_[blog_id]_options table.
    1. Change siteurl to the new domain name.
    2. Change home to match the new domain name.
    3. Change the fileupload_url to match the new domain.
  8. Your new site should now be ready, you’ll need to go in and set all the options for the domain now. If you wanted a clone of the root sites options you could copy all the rows in wp_sitemeta with a site_id matching the site you wanted to clone and just change the site_id to the new site.

The instructions above are given without any guarantee – use at your own risk, especially if converting your site from single site to multisites.  If you have any feedback or better approaches then do let us know in the comments below.

Comments
  • Peter Thomson 4 / Oct / 2011 at 6:26 pm

    Thanks for this tutorial – I had been struggling with the multiple sites setup for a while, but followed the instructions above and it now works perfectly – excellent!

  • Samuel 27 / Sep / 2011 at 6:55 pm

    Many many Thanks for this great instruction,..best wishes from germany
    Samuel

  • David 20 / Sep / 2011 at 4:50 pm

    Hi excellent tutorial,
    I would like to know if this works only in / directory WP 3 installations, or it works when WP 3 is installed in subdirectories example /blog?

    • David Coveney
      David Coveney 20 / Sep / 2011 at 5:28 pm

      You’ll need to experiment a little on a dev environment, ideally.

      Ultimately, I believe you can create multiple networks while still running in subdirectory mode *but* I haven’t tested this.

  • Peter 29 / Aug / 2011 at 11:45 pm

    Excellent tutorial! Things were up and running smoothly in mere minutes. Thank you.

  • Robert 23 / Jul / 2011 at 1:09 pm

    Hi,

    I have a question. Imagine I have two domain names installed with wordpress. When I publish one post from one domain name, will it automatically update it on the next one.. is this possible..? So that I will have two different websites with same content…

    Regards,
    Robert

  • Steven Day 30 / Jun / 2011 at 9:48 pm

    Thanks for the post James, this was by far the most information I got on this subject and I have been reading…A LOT… I have two questions for you. Number one, do you know of any published works that break this whole multi-site/multi-domain thing down? Also, if I am wanting to point domain2.com -> domain1.com/domain2 using the subdirectory method, should I still expect everything you have laid out to work?

  • Jaimin 25 / Jun / 2011 at 1:57 pm

    I would like to apply this current wp theme on my blog.
    can you please this theme?

    • Robert O'Rourke
      Robert O'Rourke 5 / Jul / 2011 at 11:39 am

      Flattery will get you almost everywhere but… sorry Jaimin, it’s a custom theme that won’t be released to the general public.

  • Tom Gremm 16 / Jun / 2011 at 2:57 am

    The floating arrow on the left is a pain in the eye.

    • Robert O'Rourke
      Robert O'Rourke 16 / Jun / 2011 at 3:07 pm

      Thanks for sharing Tom… but try and stick to the topic of the article please.

  • Jerry Lee 19 / Apr / 2011 at 9:49 pm

    Hello, I have been setting up in subdirectories forever, but decided to go this route, everything went fine, except the “add site” is not there.”My Sites” is there, but not the option to add another. any ideas?

  • Brett Widmann 16 / Mar / 2011 at 6:42 pm

    This was really helpful! Thank you.

  • Swamykant 25 / Feb / 2011 at 4:19 pm

    How to change the default role of new users in Multisite mode ?

  • Dan O'Keefe 22 / Feb / 2011 at 3:57 am

    What plugin or script do you use that displays the circle on the left hand margin as you scroll down and highlights the action buttons for the comments?

    • David Coveney
      David Coveney 22 / Feb / 2011 at 11:07 am

      It’s not a plugin – it’s a part of the theme we wrote. The animation is done using jQuery. Other bits are plain old CSS.

  • Spammy Link Attempt 8 / Feb / 2011 at 12:19 am

    So would you care to explain what a vhost alias is?
    Or you just expect that as u understand it, everybody else does too?
    This post sucks, and if you delete my comments, you are a loser.
    Explain the things needed by everybody

    • David Coveney
      David Coveney 8 / Feb / 2011 at 9:19 am

      What I love is that a: you’re offensive about the free information you got on a pretty advanced subject, and b: you try to game the comment with spammy looking links and names.

      I’ve let the comment stand because it does show the kind of offensive nonsense you have to put up with sometimes when you try and help people out. And seriously, as we said at the top, this is a guide for expert users only. If you don’t know what a vhost alias is you shouldn’t be playing with server stuff – it’s very very simple stuff.

  • Arthur 19 / Jan / 2011 at 5:07 pm

    Hey, your blog rocks!!!

  • ipank 29 / Dec / 2010 at 2:12 am

    Hi,
    I already follow your guide step by step, but it stop when I try to create blog_id_option. Do I have to create the table my self or edit the wp_options table?

  • Dan S. 7 / Dec / 2010 at 4:23 am

    Thanks for the extremely helpful guide. I’ve managed to get a couple of domains working, using this page, along with the tips here:
    http://blog.mixu.net/2010/05/31/wordpress-3-0-multi-site-multi-domain-problems-with-solutions/

    The one problem that I haven’t been able to solve is a max file size limit of 1mb. It’s neither respectful of the PHP.ini file size limits, nor any set in .htaccess

    Any suggestions?

  • theD 6 / Jul / 2010 at 11:55 pm

    I followed your directions, I think. However, I was unable to see the new domain and blog when looking in the Sites panel. The other showed but not the new one. It looks to have shown all ID 1, but not 2 of the new one I made. So I was unable to add new users. Everything else seemed to be function fine. I guess this is part of MU, but I was not even able to add a new user in the new domains blog.

    I got it to show backup in the networks Sites by changing the site_id back to 1. Everything seems to still be functioning properly.

    • theD 8 / Jul / 2010 at 10:30 pm

      Well after trying to log in the admin panel it just kept redirecting me back to login. So I changed it back. But, I did figure out where to add new users under the Super Admin > Site.

      Unfortunately, I’m unable to upload any media at all. The subdomains sites work but not the SiteID 2 site. I changed the fileupload_url to “http://site.com” as well as trying “http://site.com/files”. No luck. Just security Errors, “File type does not meet security guidelines. Try another.” even though it works on the other subdomain sites.

      • Peter 30 / Aug / 2011 at 3:49 am

        Did you ever find a solution to the new site now showing up in the Sites panel? I’m finding I have the same problem. The newly-added sites don’t show up in the Sites panel, so I can’t enable plugins or themes for the new site.

        Any ideas?

        • David Coveney
          David Coveney 30 / Aug / 2011 at 9:42 am

          Hi Peter – the tutorial is about setting up multiple separate networks in WordPress under different domains. That’s different to running one network with multiple sites using a tool such as Domain Mapping. In the former you need to log in to each network separately, whereas in the latter you use the one login. I hope that helps clarify things!

  • Dan Lacher 1 / Jul / 2010 at 5:43 pm

    Thanks. That is the site that I had been following. Turns out there was a subtle (not currently documented) item that I was missing: http://wordpress.org/support/topic/417772

    When entering the domain into the domain page for mapping be sure to NOT include http:// so in my example from above one would enter project1.com instead of http://project1.com . And then from the hosting provider just point project1.com at the same directory in which the wp.domain.com domain/wordpress install is pointed.

  • Mark 1 / Jul / 2010 at 8:51 am

    @Dan: I found this online tutorial pretty much perfect for setting up different domains on my multisite installation:

    http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/

    • Interconnect IT 1 / Jul / 2010 at 10:45 am

      Mark, thanks for the link – and it’s worth pointing out the different approaches:

      Domain mapping is where you use rewrite rules to get to the new address. Multiple domains is where each domain is fully aware of itself. From a use perspective this doesn’t make much difference, but from a server admin point of view it does. With our approach there’s no plugin running, no overhead, nothing – so it has some advantages in terms of performance, albeit slight. It’s also more ‘core’ friendly in that it just works as WP expects to work.

      Both approaches are valid, but are based on different requirements. We’ll release a plugin at some point to automate the process – we’re already using it internally, but that doesn’t mean it’s ready for general use!

      Hope that helped.

  • Mauro 28 / Jun / 2010 at 9:18 pm

    Perfect Instructions.

    Thanks!

  • Dan Lacher 28 / Jun / 2010 at 1:28 pm

    I have been reading several sites and have not been able to figure it out yet. Here is what I am attempting to do, that might not be doable w/ WP3 but seems like it should.

    WP3 master site: wp.domain.com
    Multi layered site: wp.domain.com/project1

    Okay, that all works well, but now project1 would really like to have project1.com . What site areas need to be changed (domain, path, siteurl, home) in order to get this to work. And, also, then on the DNS side, what do you set for the director of the project1 site domain name?

    Thanks for any help, I run several wordpress sites for friends and the use of WP3 MU would really help cut down on my administration if I can get it figured out.

  • Mr M 24 / Jun / 2010 at 9:00 am

    Thanks for the info, great stuff.

    I’m really struggling to get this to work on pre-existing domains running a blog in a sub directory.

    So, I want to control all my blogs from one site: sites.mysite.com

    I want to control the blog of each of my existing sites that has blog url of myothersite1.com/news myothersite2.com/news etc

    Is this possible?

    I am guessing I will have to still install wordpress in each /news directory on each site?

    Many thanks

    Mr M

  • Design blog 19 / Jun / 2010 at 11:24 pm

    Hi guys, thanks for the article!
    Can’t wait to try the new WordPress 3.0 out with the multisite option! I’ve working with wordpress MU for a while but it was doing my head in!

  • Interconnect IT 18 / Jun / 2010 at 11:35 am

    Make sure you’ve got all site ids, etc, properly set up, and have got all settings correct.

    Also check the theme you’re using, and for any plugins that have issues with multisites mode – a *lot* do.

  • ⁂ V ⁂ 17 / Jun / 2010 at 9:30 pm

    Hi, great thanks for this instruction.

    I did everything exactly you discribed and the admin area is working with the new domain. But not the home site. There is only a blank site.

    Do you have any Idea what can be wrong?

1 2
css.php