The other day, Klint Finley wrote a very good walkthrough of using the new Multisite functionality of WordPress 3.0. In the comments, a lot of people wanted to know how to use your own domain names. Since I’m doing that now, here’s a quick walkthrough/how-to guide.

Step 1: Manual Plugin Installation

The Domain Mapping plugin is not your regular kind of plugin. You cannot install it through the normal Plugins->Add New menu. Well, actually, you can, it just won’t work.

So first, download the plugin manually.

Note: For this tutorial, I will be using the WordPress MU Domain Mapping plugin. However, I am using the trunk version of the plugin. It has fixes in it that you will need for proper 3.0 support. Don’t try it with the regular version. (Note: The regular version works fine. This was originally written before the latest version, or 3.0, was released.)

The plugin has two main files you need to put in the proper places.

Domain mapping php file location

The first file is the domain_mapping.php file. This needs to go into the mu-plugins folder. The mu-plugins folder is a special folder, which you may not even have yet. Just create it underneath the wp-content folder and put that file into it.

Sunrise php file location

The second file is the sunrise.php file. This is a special filename for WordPress. Don’t worry about it, just put it in the wp-content folder.

Step 2: Activate Sunrise

Now you need to edit your wp-config.php file. Add this line of code to it:

define( 'SUNRISE', 'on' );

Simple, really. This will cause WordPress to go load that sunrise.php file and use it.

Step 3: Server info

Now you have to configure the domain mapping plugin so that it knows what it’s doing properly. This is easy to do, really. Go to your main domain’s admin page and log in as a super admin. Then go to the new Super Admin->Domain Mapping menu.

Domain mapping setup screen

Here you have a few different options, but two main ones that count. You can either put in the IP address of your server (as defined in your domain’s main A record) or you can put in a CNAME that points to your server. The IP address is what most people will want to use. If your server uses more than one, you can enter them all here, separated by commas.

Other options on this page:

  • Remote Login – This will make your login pages for all sites redirect to your main site to do the actual login. The benefit of this is that when you log in to one, you log into all of them. The downside is that the URL changes to another domain in order to log in.
  • Permanent redirect (better for your blogger’s pagerank) – This makes your subdomain or subdirectory sites redirect to their domains. You should leave this on.
  • User domain mapping page – Turn this on if you want users to be able to put in their own domains for mapping.
  • Redirect administration pages to blog’s original domain (remote login disabled if redirect disabled) – This makes all admin pages show up on the original domain instead of on the new domains. You need this enabled for remote login to work.

Generally I leave only the middle two on. Remote-login is iffy at best, and I want my new domain name to show up everywhere.

Step 4: Mapping the Domain

There’s a bit of a prerequisite here before you do this. When you buy a new domain, you will need to edit its DNS settings to actually point to your server IP or CNAME or whatever you do to make the domain connect to your server. For me, I just give it a new A record with my server IP in it. Easy.

Update: Okay, so there may be more to it than just that, depending on your host. Every host is different, and you’ll have to talk to your host to make them able to point the domain name at your existing site. How to do this varies from host to host, but the important thing is that when you visit your new domain (before you do this!) then you want it to go to your main site, as is.

There’s two ways you can actually map a domain to one of your sites. The user screen is the simplest way, if you left that option on before. Log into the site you actually want to map to a new domain, then go to Tools->Domain Mapping.

User Domain Mapping Screen

All you really do is put in a new domain and set it as the primary. Simple.

Note that if you didn’t get the domain pointed at your server before doing this, then your site will instantly vanish from the realm of mortal man. Setting the primary domain takes effect instantly. You won’t be able to access the site through the old domain any more.

The other way to set domain mapping is through the Super Admin->Domains menu. Here you’ll find a list of sites and their ID numbers. You can map an id number directly to a domain name here. The Tools approach is a bit easier to use, but this will allow you to map domains without visiting them, as you can access this list from your main domain. You can also correct broken domain mappings from here.

Step 5: Seeing the Mapped Domains

If you go to Super Admin->Sites, you’ll find this type of a listing:

Sites listing

You’ll note that on the right hand side you can see the column showing the mapped domains.

Special Note: See in the picture how I’m using a subdirectory install? That’s relatively new. In older versions of the domain mapping system, you had to use a subdomain installation and wildcard DNS for domain mapping to work. This is no longer the case, domain mapping works just fine with subdirectories.

Conclusion

And that’s how it’s done. It’s not super complex, but it does require some knowledge of DNS and how servers work. If you can successfully set up a multi-site install to begin with, you can probably do this as well. Just be aware that it is slightly finicky, and know that you will break your site if you put in the wrong settings somewhere. However, your main domain will always be accessible as long as you don’t try to map it, so you’ll be able to go in from there to correct your mistakes.

Shortlink:

1,194 Comments

  1. Great tutorial and very helpful. One point to note for those using IIS and multiple web sites as well as the WordPress MultiSites.
    The IIS website which hosts the WP Multisite Network will require an additional Host Header Record for each subdomain.

  2. hi I followed the instruction up to step then when go back to my login page I get this

    The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around.

    does any one have any Idea wats going on

  3. Ok, I’m stuck on step 4.

    I’ve got a Hostgator Baby plan and my domains are at GoDaddy.

    I’ve got my domains Name Servers changed to my Hostgator account.

    I set up an addon domain from CPANEL.

    Do I redirect my mapped domain to maindomain.com or maindomain.com/mappeddomain/ ? It doesn’t seem to be working either way…

    • You don’t “redirect” anything. You want your new domain to be pointing at the same hosting account (IP) and the hosting account to know the domain should be served from the same directory as your main domain (/ or /public_html or whatever the root of your domain is).

      In other words, make all the domains go to the exact same place: your WordPress installation. Let WordPress worry about what to serve to them.

  4. Everything seem to be working on my sites! But when I go to, for example discoverdarienga.com it comes up find, but the address it shows is discovergeorgiacoast.com/darien which is the folder instead of the discoverdarienga.com. I’m I missing something?

  5. Hi, I followed everything said in here, but when I try and load the webpage I need mapped, I get this error message:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@tipboss.johnsuarez.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    However, if I type in the subdirectory domain, it loads fine.

    Any idea how I can fix this?

    If it helps, I am using webhostingpad.com as hosting, and dynadot.com as my domain registry.

  6. Running into an odd bug. I’ve got main.com in a multi-site with domain mapping with a few subdomain sites under it mapped to their own domains. Everything seems to work fine except after about 10-15 minutes the main.com site goes down and displays a blank page, though the mapped subdomains still show up fine.

    If re-create domain-mapping.php, main.com comes back up but then goes back down 10-15 minutes later. Not seeing any errors in the log files, though the behavior seems like a DNS/vhost/cache issue?

  7. Great stuff, but having a major problem with domain mapping. I notice under your great tutorial you have the domain mapping under the tools, for me it comes under the super admin and does not allow me to add different domains only sub domains. Any ideas why this happens and how to fix this problem.Thanks, JD

  8. i followed the steps but neither domain mapping nor domains options showed up on neither Admin site menu nor tools menu.. when i checked the subdirectory site, the only thing that was added on my tools menu was the delete option.. where exactly should i put the define(‘SUNRISE’,’on’); on wp-config.php? also, do the mu-plugins and sunrise.php should be in the wp-content folder of the main public_html directory or should be placed into wp-content folder of www directory?? please help on this matter.. im working almost 2 hrs just to fix this prob but i really don’t know what to do next.. thank you in advance.

  9. I’m having the same problem as a few others here:

    I have mainsite.com setup as the root, and mainsite.com/newsite/ supposed to go to newsite.com

    But when i go to newsite.com, it redirects back to mainsite.com/newsite/

    I have both “Remote Login” and “Redirect administration pages…” domain options both unchecked. Any ideas?

  10. Thanks Otto,

    But now it’s doing a Redirect Loop.

    Wonder what i’ve got set wrong…

    • You’ve probably setup the domain to redirect to the subfolder somehow. That’s not the right way to do it. Instead you need to setup the domain to simply point to your normal webhosting account, at the root folder.

      In other words, your domain needs to have an A record pointing to your web server, and your webserver needs to know to direct traffic for that domain to your root hosting account.

      All my domains are setup to point to exactly the same location. Same A record, same hosting account settings. The domain mapping plugin and WordPress takes care of what to display. You’re not wanting to make your domain redirect, you’re making it go to the site like it would go to a normal hosting site.

      Alternatively, if you’re using Firefox, it caches redirects. Clear the cache and restart the browser a couple of times.

      • Awesome, thanks for the help – i found out what the problem is and i’m sure others will have the same.

        With Cpanel, you need to add the domain as a Parked Domain – not an Addon Domain. Also make sure there’s no redirects like Otto advised.

  11. Hi,

    We are actually facing a problem, once we follow the steps to install the domain mapping plugin it simply doesn’t load the dashboard. Starting from the ground up again is not an option for us as we just migrated to wp 3.0.1 and just cant understand the issue behind this.

    Any suggestions????

    Thanks…

  12. What if I want the other domains to be spread out on different servers? I have an account at SEO Hosting where I have different sites on different IP addresses, but I want to manage them all from one site which is on a different server. For the secondary sites, I’ve set the DNS wildcard to redirect to the network IP address where the main site is located. I also set each site as the primary for their respective folders within the main admin panel. But it’s still showing the old site, and not reflecting the new one. Anyone know what to do in this situation?

    • You can’t do that.

      The whole point of multisite is to run multiple sites from a single installation.

      If you’re running on multiple servers, you will need multiple installations, and they will not be connected to each other in any way.

  13. Hi! I’m using domain mapping plugin on a 3.0.1 multisite, and everything works great except for thumb.php generated images on mapped domains.

    Before mapping the domain, the img src looks like this and DOES work:
    http://multisite-root.com/sitename/wp-content/themes/theme-name/thumb.php?src=/blogs.dir/3/files/2010/08/Koala.jpg&w=100&h=100&zc=1&q=90

    After mapping the domain, the img src looks like this and does NOT work:
    http://mapped-domain.com/wp-content/themes/theme-name/thumb.php?src=files/2010/08/Koala.jpg&w=100&h=100&zc=1&q=90

    any ideas? Thanks!

  14. Hey Otto:

    We moved out site to root, but for some reason, the plugin won’t Activate. We’ve got sunshine in the right folder, we’ve added the code to htaccess and wp-config.

    Here’s a post on Codex I added today with the code: http://wordpress.org/support/topic/plugin-wordpress-mu-domain-mapping-plugin-wont-install?replies=1

    Any ideas why it won’t activate?

    Tony

  15. Got a problem here with domain mapping.. i want to map my subsite http://mydomain/site1 to http://anotherdomain.. i followed all the steps from editing the DNS Zone in WHM to creating a parked domain.. when i go to the site.. it only displays Server Error.. it’s like im not connected to the internet..

  16. Otto:

    Do you know what this means when you try and activate the plugin; Fatal error: Cannot redeclare dm_text_domain() (previously declared in /var/www/wp-content/mu-plugins/domain_mapping.php:29) in /var/www/wp-content/plugins/wordpress-mu-domain-mapping/domain_mapping.php on line 30

  17. Okay, so if I take domain_mapping.php out of the plugins folder and move it to mu-plugins, then the plugin disappears from the plugin page menu.

    Basically, I have domain_mapping.php in mu-plugins and sunrise.php in wp-content. I’m not seeing Domain Mapping in the Tools menu.

  18. Now I have this: Please edit your /var/www/wp-config.php and move the line define( ‘SUNRISE’, ‘on’ ); above the last require_once() in that file.

    Here’s my code:

    /**
    * For developers: WordPress debugging mode.
    *
    * Change this to true to enable the display of notices during development.
    * It is strongly recommended that plugin and theme developers use WP_DEBUG
    * in their development environments.
    */
    define(‘WP_DEBUG’, false);

    define(‘WP_ALLOW_MULTISITE’, true);

    define( ‘MULTISITE’, true );
    define( ‘SUBDOMAIN_INSTALL’, false );
    $base = ‘/’;
    define( ‘DOMAIN_CURRENT_SITE’, ‘dev.reesefelts.org’ );
    define( ‘PATH_CURRENT_SITE’, ‘/’ );
    define( ‘SITE_ID_CURRENT_SITE’, 1 );
    define( ‘BLOG_ID_CURRENT_SITE’, 1 );

    /* That’s all, stop editing! Happy blogging. */

    /** Absolute path to the WordPress directory. */
    if ( !defined(‘ABSPATH’) )
    define(‘ABSPATH’, dirname(__FILE__) . ‘/’);

    /** Sets up WordPress vars and included files. */
    define(‘SUNRISE’, ‘on’);
    require_once(ABSPATH . ‘wp-settings.php’);
    101,1 Bot

  19. Everything works great except that the pages throw 404’s and the posts don’t show up listed on the front page unless you mark them “sticky”. The posts still show up listed in the normal widget that shows recent posts. I can still edit posts and pages. It seems to stay the same whether I turn on or off the W3 Total Cache or any other plugins. And this affects not only the mapped domains but the other domains seemed to start behaving this way, too. After I de-installed the domain mapping plugin and turned off the SUNRISE thing, the problem remained across the subdomains.

    There is one thing I do a little different from what’s standard, and that was I moved the .htaccess
    stuff into files “Included” by httpd.conf for performance and so I could just copy and modify things when adding another domain. But, it has worked perfectly without domain mapping and continues to work perfectly for the other WPMU installations I have on the same system using the same methodology. I tried looking at the wp_17_posts table and other numbers to see how some of the fields, such as guid look and compared them to some of the other sites. They seem to be normal as far as I can tell, though I’m not sure if they’re supposed to be relative to the subdomain or the domain the site is mapped to, or whether or how this is to be taken care of automatically.

    I wonder if anyone else has ever run into this. It’s probably something weird that I did. I’m
    on 3.0.1. If nobody has seen this, I’ll continue to dig through source code and see if I can find
    the root of the problem.

    Thanks,
    Dan

  20. Can someone help me every time I turn on the sunrise php in my config file I get this error “The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around.” what does this mean?

    • Perhaps someone else can help verify whether what I’m saying is correct or not, but my understanding is when they’re talking about “root” or “/” in this situation, what they mean in terms of the Unix filesystem (or windows, too), it is the DocumentRoot. For example, if you have a virtual host on Apache that says the DocumentRoot for is /var/www/html/mysite, then your installation would need to be there and not in a subdirectory such as /var/www/html/mysite/wordpress. If you installed it there, you might be able to go back to your httpd.conf file or whatever you’re using for that vhost and set the DocumentRoot and the Directory entries appropriately so that /var/www/html/mysite/wordpress is now the DocumentRoot.

      In other words, it’s not telling you that you have to put your installation into the root filesystem of your system. That would be terrifying to most Unix system administrators to think about doing that 🙂 It would be for me 🙂

      Dan

  21. It can be n different places, but mine is in /etc/httpd/conf/httpd.conf.

    I ended up backing off from the domain mapping for now. I’ll stick to plain wpmu for blogs and drupal for packing several cms sites into one installation. Both are really excellent, but each one does some things better than the other. I’m finding really don’t want to be without either.

  22. Hi Otto,

    Great tutorial I have managed to setup the primary wp site with multi-site and domain mapping but now just need some help with mapping my first domain.

    My new domain is at godaddy and I have a vps hosting with mutliple ips. If I want to setup a mapped domain using a one of my available ip addresses how do I set that up at godaddy? I’m a little confused as to:

    1. How I assign the ip address from my hostgator vps account to the domain at godaddy
    2. What settings I need to change in the domain manager for the domain at godaddy to assign the ip and how I setup the dns. Do I need to setup a wildcard subdomain/virtual host record to the site’s DNS record in godaddy and how do I do that.

    • Shush:

      I believe at GoDaddy you set the A Name record to the IP address of your HostGator VM (ex. 111.111.1.1). You should put this IP address in your Domain Mapping settings.

      If you are using domain.com/subdirectory there is no need for wildcard, but if you are using site.domain.com, then you should set up an A Record using “*” and pointing to your IP address.

      Is that correct, Otto?

      Tony

      • Yes and no. With godaddy, you need to purchase a static IP address for your site, in order to get wildcard mapping to work.

        However, you can use subdomain without wildcards. You just can’t create them on the fly via WordPress. You’ll have to add a CNAME or A entry for each subdomain you make.

        None of this applies to subdirectory mapping.

  23. OK, Really stupid question: I’m at step 3. How do I find my server IP address?

    • Ha…do I give the long, complicated, confusing, but correct answer and try to make it understandable later, or do I cut to the chance and give a few short things to try?

      How about pinging the server? Type “ping myserver.com” whatever myserver.com is.
      Or “nslookup myserver.com”
      Or “dig myserver.com”

      With nslookup you’ll get much more information.

      That is if your system is set up with a hostname and IP address known to the rest of the world in various DNS servers everywhere.

      If you’re logged into the machine, say on a console, you might be able to type
      “ifconfig -a” to get a listing of all the IP addresses your system is listening on.

      Your system may have an /etc/hosts file where you can see what the IP address is.
      You can type “whois myserver.com” to find out where the main, authoritative nameservers are for that hostname and all the administrative information on it, or if you’re not on a unix or linux system, you can browse to whois.com or go to godaddy.com, log in, and all in all, there are a zillion ways to find out what IP address or addresses a given hostname is mapped to.

      If you are getting hosting or getting a VPS from a company like ubiquity, they should provide that information for you in your emails from them. If not you can contact support, and then you can set up your own DNS to map your domain to that address with an “A” record, or in this case, if you’re using subdomains for wpmu, you may want to map your domain to that IP, then map * to that domain, and perhaps a servername you want to use to that domain. Then set up an MX record for where the email for that domain is to go. Godaddy.com has a TotalDNS you can use with their DNS servers and it works great keeping the DNS traffic close to the middle of the internet (that’s like saying middle of the universe, or halfway between minus and positive infinity).

      If you find your IP address is 127.0.0.1, that’s localhost. That’s for traffic between processes within the same computer and not for traffic on the internet. That would be wrong.

      If you find your IP address is something like 10. something or 192.168. something, then you’re working with an IP address that is not reachable from outside your local network unless your router is mapping incoming port 80 and/or 443 traffic directly to your server or through other network devices to your server somehow, but that gets into a whole-nuther sticky mess.

      Dan

    • Hey Rob, just go to http://whatismyipaddress.com/ and it displays your current ip

  24. Hi Otto, great to read your blog.

    I have a main blog (A), from which I control the other domains. There are other blogs (B, C, ..) Everything is working well, excepted when new user registers to the blogs B, C.. : he receives an email with a link to the domain A, and when he try to login, they access to the dashboard of the blog A (instead of B), and can’t post an article.

    Another little issue:
    When I did a speed test (http://www.webpagetest.org), I saw the following call:
    http://BLOG-A.net/?dm=1ce9a77cb5987bce31a9dbe9823feed9&action=load&blogid=16&siteid=1&t=1177046446&back=http%3A%2F%2Fwww.BLOG-B.fr%2F

    That takes almost 1 second to be loaded.

    Do you mind to help me please ?
    Thanks !

  25. Using MU Domain Mapping is it possible to actually support multiple domains rather than a re-direct. As we have installed MUDM at the moment it works… sort. What actually happens is that once a user has conected to the primary domain http://www.teamfans.com for example, they are re-directed to wp.multipledomainhost.com/teamfans for all subsequently served pages.

    What is required is that the primary mapped domain is to exist in it’s entirety so that all pages are served from that domain.

  26. Now I figured it, it seems you need to set the Site Info (wp_blogs) Domain correctly to the mapped domain and Site Options (wp_siteid_options) Siteurl and Home correctly to the domain too. Then it works. I suspect that the upload directory needs changing too. None of these things occur automatically when you create a domain mapping. I have also found that the checkbox Update siteurl and home as well. seems to have unpredictable, or rather difficult to understand results.

    Robert

  27. Hello Otto-

    Your tutorial was extremely helpful in getting my multisite up and running!

    I have one disappointment about privacy. My primary site is my business site and the secondary site is entirely personal, and supposed to be anonymous. However, when you watch the browser’s (firefox)path to the second site while it loads (in the address bar at the bottom), you can see it hit the primary site address just before the plugin maps it to the secondary site domain. Occasionally when the servers are busy you can see “waiting for primarysite.com” before it gets mapped.

    Is there any way to keep visitors to the secondary site from ever seeing the address of the primary site?

  28. Hi Otto –

    This is the best explanation I’ve found online (without a doubt!) and I should know because I’ve read just about every one of them by now. I’m so close now I can taste it, but for some reason I keep getting the “Sorry! This site is not currently available.” page from godaddy. I noticed you’re using godaddy, does this mean that I just need to be patient and wait for everything to get set up or did I do something wrong?

    Right now, I’m able to see all the same menus as you including all the super admin settings and even the Domain mapping option under tools when I log directly in to the wp-admin account for the secondary site I’m trying to create. I’ve set the Aname in my DNS settings to the Ip address for the original site and have the same number in place for the initial domain mapping settings. At this point, I’m at a loss. I don’t know why my chosen domain for the subdirectory site is not working. I even tried creating another multisite as a tester and set up the server settings for that domain to “park” ,as one of your readers suggested, and this time I only get the “coming soon” Godaddy page. Please somebody help.

    Thanks in advance!

    • With GoDaddy hosting, there’s two steps on a new domain I use:

      1. Point the new domain to your hosting account. To do this, you use the DNS editor and put in your hosting server’s IP address for the main “@” record.

      2. Set up the domain on your hosting account. To do this, you go into the hosting control panel, find the “Domains” area, and add your new domain to point to “/” or the root of your web account.

      That’s all there is to it really. Usually takes about an hour to get working after that. If you do these steps *before* attempting to map the domain in WordPress, then when you visit your new domain, it will get redirected to your “main” domain. However, when that happens, you know it’s set up right and when you make changes in the domain mapping plugin, you’ll see the effects instantly.

    • Here’s a couple of screen shot examples.

      DNS: http://ottopress.com/files/2010/09/godaddydns.png

      Domain Manager: http://ottopress.com/files/2010/09/godaddydomainman.png

      Pretty straightforward, really. I don’t know what “parking” does, but I’ve never done it.

      • Ott:

        I’m getting this:

        The constant “COOKIE_DOMAIN” is defined (probably in wp-config.php). Please remove or comment out that define() line.

        I don’t have that line in my config file.

        Tony

    • I had a similar problem on a Plesk VPS environment and the resolution was to remove the “physical hosting” that my to-be-mapped-domain previously had setup. It seems that with that in place, it takes precedence over the fall-back domain mapping from the primary site.

      Thanks for great walkthrough and answers Otto!

  29. Ah ha!! Thanks so much Otto. I was just missing step 2…

  30. Otto:

    We have a dev server and production server with two different IP’s.

    dev: 152.19.196.121
    production: 152.19.196.191

    I have input the dev IP into its admin and the production IP into its admin.

    But, I can only point the DNS for domain1.org and domain2.or to one IP, which is production (152.19.196.191). Is that correct?

    Because I’m not pointing the DNS entries to dev, my domains won’t work there. I can still each sites admin.

    What’s your workflow for rolling code from dev to production and testing domain mapping before rolling to production? I just need some help trying to figure that out.

    Tony

  31. Does anyone have an idea of how to set up the wordpress multisite so that each of nested sites has it’s own database? I imagine it’s got something to do with the WP-config file, but I’m not sure how to tell the browser to access the right settings and right database for each domain.

    Alternately, if you stick with the one database assigned to the super admin, does wordpress set up the various nested sites data in a way that will allow you to easily extract it later?

  32. Otto:

    Simple question:

    I’m changing the siteURL. In SuperAdmin – Sites – Add Site, the URL is hard set in the database. What table is it in so I can change it?

    I’m looking through all the tables but can’t seem to find it.

    Tony

  33. I seem to be unable to get the domain mapping to work on the root site. Worked fine with MU 2.92 installs but cant get it to happen with 3.01 at all.

    Digging about it seems that the root site has an ID of 1 but the prefix in the DB is not 1, ie wp_X_ in the DB for all blogs but the root site which is simply wp_. Not sure if that is important or not!

    Tried several installs, setting network/multisite in the wp_config before installing etc but nothing seems to work. Mapping works fine on all the other sites just not the root site.

    Anyone with any more ideas help would be appreciated!

    • I think the Root site is the Root domain.

      So, if you have “domain.com”, that is the main domain at “/”, and it runs itself.

      If you want “domain2.com”, you add a new site under Admin – Sites, so that path is example.com/domain2/ to that site.

      The, go to domain mapping and use the ID num of that new site. The ID should be “2” and then go into Domain Mapping and map ID 2 to domain2.com.

      Tony

    • Simple answer: You can’t do that. You cannot map the root site anywhere. It’s the root.

      Choose your root carefully, because it can’t be easily changed.

  34. Otto:

    I have everything set up correctly.

    Now, my domain “http://www.reesenews.org” is redirecting to http://www.reesefelts.org/reesenews/.

    I want it to just resolve to reesenews.org. Is that the setting under Domain Mapping where you have the check boxes?

    Tony

    • Did you set it as primary?

      • Otto:

        Sorry, I figured it out.

        ReesFelts.org is primary “/”, but when you are in the site’s “backend” there is no setting for Domain Mapping under Tools, since it is the primary site.

        Once you add sites, I learned you have to navigate to each individual site’s Backend, then set the domain mapping under Tools.

        It wasn’t very clear to me, but I got it now.

  35. Also, when trying to recover a password from the login page, I am getting: “The e-mail could not be sent.
    Possible reason: your host may have disabled the mail() function…”

    I don’t recall disabling email at the host. Any suggestions?

    Tony

    • I figured it out. It had nothing to do with the Domain Mapping and everything to do with the server not being configured for mail. I’m working with a university issues server that’s clean and had to install apache, mysql, phpmyadmin, etc… myself.

      Tony

  36. Otto, can you please help me out.

    Hosting:
    I’m using Hostgator Baby Plan (Shared Hosting)

    Primary Domain:

    I’ve Primary Domain such as http://microicon.com [example purpose given]

    Multisite enabled TLDs domain: [Sub-domain]
    and I’ve 5-6 domains are connected. From one of them, such as, http://web.im => I enabled Multisite options. I’ve selected [sub-domain] for this site to create http://sakib.web.im or http://otto.web.im or http://google.web.im.

    Problem Is:
    When the sub-domain created, and clicking to http://sakib.web.im => it’s redirecting to my primary website at http://microicon.com. Though the web url looks, http://sakib.web.im

    FAQ:
    1. Is Server IP is same?
    Yes, As you’ve instructed, the Server IP address both http://web.im and http://microicon is same.
    2. Where do you installed the WordPress in your server?
    Under the, /public_html/web.im/[all fresh installed files]

    Need Your Help:
    Can you please tell me, what to do right now to handle this situation?

  37. […] contributor Otto has written a great guide about domain mapping in Multisite mode in WordPress […]

  38. Thanks for the great walk through – I have a strange problem where the first two sites under the root site work correctly after following your directions, but the third site which was set up in EXACTLY the same way continues to give me the Apache error page – Great Success !
    Apache is working on your cPanel® and WHM™ Server etc etc, but will not map to the relevant subdomain.

    The domain in question is breamore.hants.sch.uk, one of the working sites is oldchapelfood.com, under the root somain hiexposure.com.

    When breamore.hants.sch.uk is not set up as the primary, the subdomain works fine – http://breamoreprimary.hiexposure.com/

    Anyone have any ideas as to what I have done differently??

    Thanks in advance!

    • Disregard the above – it just took longer for this one particular domain to propagate than the others – so the four hours I spent scratching my head wondering what I had done wrong were only slightly wasted 🙂

  39. Excellent tutorial.. Very detailed

  40. I am setting up several WordPress sites. I have considered networking them in WordPress 3 or setting them up as independent blogs on independent C servers. I understand that the one IP concept of WordPress networking will get lower SEO than linking several independent sites on separate servers. Any comments would be appreciated.

    • Where your sites are hosted has zero effect upon SEO. Google and other engines don’t care about IPs.

      • From the web: “Actually, Google handles virtually hosted domains and their links just the same as domains on unique IP addresses. If your ISP does virtual hosting correctly, you’ll never see a difference between the two cases. We do see a small percentage of ISPs every month that misconfigure their virtual hosting, which might account for this persistent misperception–thanks for giving me the chance to dispel a myth!”

        -Google Director of Technology Craig Silverstein Slashdot interview

  41. […] had option one enabled  but not option 4.  For speed I’ll quote from a person called “Otto” with a brief […]

  42. Hi Otto,

    Many thanks for this article and the plugin. We have very specific requirements, and I want to make sure that using WordPress 3.0 and your plugin will do what I want it to, and I don’t go down a blind alley!

    We have built a CMS that will host multiple sites with multiple TLDs. The TLDs all point at one IP address and our CMS works out which site to display.

    We want to be able to add a WordPress blog to each of these sites.

    I am planning to host the WordPress blog in the root of a completely separate site with it’s own TLD

    We would need the each blog to sit in a subdirectory – not the site root:

    e.g.
    http://www.wordpress-site.com/client-site-1/ – maps to: http://www.client-site-1.com/blog/
    http://www.wordpress-site.com/client-site-2/ – maps to: http://www.client-site-2.com/blog/
    http://www.wordpress-site.com/client-site-3/ – maps to: http://www.client-site-3.com/blog/

    Is there anyway to use your domain-mapping plugin to point directly to a subdirectory of a domain, rather than it’s route, whilst leaving our CMS to run untouched outside the blog directory.

    e.g.www.client-site-1.com/our-cms-page/

    Thanks

    Ben

    • Ben:

      I won’t speak for Otto, but from my understanding, here’s the way things are mapped in the system.

      Setup:

      root – domain.com
      site 1 – domain.com/site1
      site 2 – domain.com/site2

      Mapping:

      domain.com/site1 – maps to: newdomain1.com
      domain.com/site2 – maps to: newdomain2.com

      I don’t believe you can map it like this:

      domain.com/site1 – newdomain1.com/blog1
      domain.com/site2 – newdomain2.com/blog2

      You map the root domain, then map additional domains to either sub.domain.com or domain.com/subfolder, such that you get newdomain.com.

      I don’t know if you can map a domain to newdomain.com/blog1.

      I could be wrong, but that’s how I understand it.

      Tony

  43. ok, here’s a quick one i think i know the answer to, but wanted to check anyway.

    If i set up a multisite at:
    http://m.devgaming.net

    is there anything stopping me from redirecting http://m.devgaming.net/home to http://devgaming.net ?

    Also obviously i doubt there is any problems with m.devgaming.net/test becoming test.devgaming.net

    Thanks

  44. Otto:

    Can I set blogs.dir to 777? At 755, it’s not writable. The main wp-content folder is at 755, but not blogs.dir. Let me know if that’s a security risk.

    Tony

  45. Great “how to” post. Big thx. WordPress + Mapping Plugin works perfect 🙂

  46. […] Instalacja WordPress 3.0 w wersji MS daje ogromna możliwości, które dzięki odpowiednim wtyczką daje się znacząco rozszerzyć. Jednym z ciekawszych “rozszerzeń” jest możliwość połączenia WP 3.0 w wersji Multi Site z pracą z wieloma domenami. Taką możliwość daje plugin WordPress MU Domain Mapping Plugin , dokładna instalacja tego dodatku została opisana na stronie WordPress 3.0: Multisite Domain Mapping Tutorial. […]

  47. Anyway of going about allow each mapped domain to use a unique wp-signup.php? Seems with mapped domains all signups go to the root site…can’t seem to find an option for each site to have their own.

  48. Hi Otto,

    Many thanks for a great tutorial.

    I am trying to get WP 3 running in multisite subdomains mode. I have followed your tutorial to the letter (at least I think so 🙂 ) but once everything is done I can’t access the new subdomain site or it’s wp-admin page.

    After trying several things with no joy I have tried using a parked subdomain (I was using add-on subdomains) and now everything seems to work fine.

    Does this makes sense to you? Is it true then that I can’t use add-on subdomains?

    It is kind of a problem as moving them to parked domains means losing all the mail forwarding configs, etc.

    Thanks,

    Javier

  49. Thanks Otto for this tuts..

    I’ve got a problem when I try to setup multisite. The structure I created would be:
    root – domain.com
    site 1 – domain.com/site1
    site 2 – domain.com/site2

    Mapping:
    domain.com/site1 – maps to: newdomain1.com
    domain.com/site2 – maps to: newdomain2.com

    I’ve set the domain mapping as Primary. I’ve checked the Site ID. But still cannot understand why the url I see at newdomain1.com pointing to domain.com/site1. I also happens to newdomain2.com. I’ve spent several hours just trying to figure it out. Could anyone give me some direction?

  50. Now I have another problem.. My main site (root) is dead / blank / white page. Wp-admin is dead too.

    If I remove the mu-plugins folder, my main site live again. What’s wrong with this? Any ideas?

    • Ok, just figure the problem out! The problem comes from duplicate domain-mappings.php in wp-content. You have to delete domain-mappings.php from the plugin folder and only put it on mu-plugins folder. That solves the problem.

      Cheers! 🙂

      PS. Sorry Otto, I’m kinda frustated spending several hours for such stupid mistake. Simple solution for the guy who doesn’t follow the installation step carefully..

      • Make sure sunrise.php and blog.dir are in your wp-content directory as well. Make sure blogs.dir permissions are set correctly, because that folder needs to be writable.

        Also, once you’ve got it going, remember that you can only change the mapping of the site 2, 3, etc… under their Backend – Tools panel. That wasn’t clear to me. Site 1 is already mapped to a URL, it’s site 2 and 3 and so on that you have to map from site.com/site2 to site.com.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Need to post PHP code? Wrap it in [php] and [/php] tags.