WordPress 3.0 Multisite With Multiple Domains Setup

Development

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.

22 responses to “WordPress 3.0 Multisite With Multiple Domains Setup

  1. Open up the db for editing and add a new row to wp_site table

    site_id, domain and path.
    site_id, will be a new unique id, remember it
    domain, should be set to the new domain name added above.
    path should be /

    Change the row in wp_blogs that matches your new site and make a note of the blog_id.

    Change site_id to the new site_id created above.
    Change domain to our new domain name.

    Open up wp_[blog_id]_options table.

    Change siteurl to the new domain name.
    Change home to match the new domain name.
    Change the fileupload_url to match the new domain.
    My query is :

    1.Where it table wp_site,wp_blogs & wp_[blog_id]_ table
    2.Suppose i have two domain xyz.com & abc.com.I want to run these sites in different languages but centalize admin.

  2. Good post, very useful for me, thank you.

    One question:
    How select the new domain create for a new site?

  3. Hey great tutorial but I wanted to ask that can I have multiple sites common wordpress files but different database for each website I think in wp-config file I can get the host calling those files and connect to that database accordingly and each website runs with different data but the files or the wordpress code is same for every site Including the template but I do not knoow how to redirect each domain to a common folder containing the wordpress installation and other plugins It is helpful for if I change the design for a site it simply changes the design of other domains also. Please suggest.

  4. Hi, James,

    Great article! I’m just in the process of making something like this and I’d like to hear your insight on the idea…

    I am currently writing three blogs for the products of the same company. Now I want to integrate them in the same blog. Articles would be on their own domains to improve SEO and to deliver a bit different design for articles on product #1 etc…
    The only thing that would be the same for all blogs is the header that has a navigation bar that leads to all blogs (divided into categories).

    Is this possible in any way?

    Thank you 🙂

  5. That is great…i guess, i have to make some neccessary changes in .htaccess file. is’nt it ?

Leave a Reply

Your email address will not be published. Required fields are marked *