WordPress 3.0: Multisite Domain Mapping Tutorial
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.
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.
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.
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.
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:
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.
Related posts:






Hi, I installed the plugin, everything worked great. But when I tried it again, it just doesn’t seem to work. I can add a new domain, but when I make it the primary it just says it cannot find the server. Are there any incompatibilities with other plug ins? The only thing I did between the last one that work and this one was install an SEO plug in “WordPress SEO” but I am afraid to deactivate it because I might lose all the work I did on that plug in.
I know it works, because if I do not make it the primary domain, it goes to the site that I assigned it but as soon as I make it the primary domain, it breaks. The last time it worked on a different site once I activated the new primary domain, it forced me to log in to the site with the mapped domain, but this time it does not seem to be doing this.
Any ideas?
HELP!!!
I have recently tried to configure the domain mapping tool. It was all working well until i had to do the actual mapping. My site is ifnt.us and the sub directory site is ifnt.us/montessori, the url i was trying to map to the sub directory site was montessoricommons.cc. As soon as i hit Make Primary / OK, the whole site disappeared, and i can’t login or access it at. Im using go daddy for the hosting and I am quite new / self taught on all of this so I’ve done well to get this far.
Now i cannot access my site at all. It was a new install, so i can begin again if i have to, but damn, thats a lotta work. Any ideas / help or pointers would be legendary.
If you’re on shared hosting with GoDaddy, did you add each domain to the GoDaddy hosting control panel? If so, did you create a symbolic link, pointing each additional domain to the primary domain of the network?
Remember, that when you point a domain to the IP address of the server, the domain name has to be registered in the DNS, so that the server can field the request for that domain and point to the correct folder on the server. A symbolic link passes the request on to the primary folder in the network.
If you were on a VPS account, it would be different, but with shared hosting, you have to set up the symbolic link between the additional domains and the primary one that you set up WordPress on as the lead in the network.
Many thanks, everything works like a charm!
Hello,
I’m wondering which domain will be using to ping when a post published?
Disable primary domain is checked.
Thanks.
Is there a version of these instructions anywhere that are updated with the changed menus and labels of WP 3.2? The instructions here don’t actually work.
Never mind – the missing detail was that, if you already have WordPress installed on foo.com and you want it to respond to bar.com as well, you need to first create a subdomain called something like bar.foo.com, and go into the backend for that. I was rummaging around in the backend of foo.com for ages and not finding anything that matched the descriptions of menus and options. On the tenth re-reading of the appropriate section of this or some other tutorial, I finally realised what I was doing wrong. Now it’s all working. So thanks!
[...] WordPress 3.0: Multisite Domain Mapping Tutorial [...]
Very very useful article for shared hosting people like me, recently installed my blog, and I have been trying to install add on domain and found that it is installing on sub directory on my primary domain. Tried, tried… frustrated and decided to go for a new hosting provider. Before migrating just googled and found the solution. Thnaks you have saved me $89(to signup on hostgator).
Thank you!
Hi Tony and everyone else,
Can you review this plan for me as I am unsure how to proceed?
My client currently has 2 websites – domain1.com and domain2.com – but has set up domain3.ca with a new web host for multisite testing, eventually migrating domain1.com and domain2.com over.
Do I install WP on domain3.ca then add a subdomain for the 2nd site?
Once everything is working, can I migrate both domain names – domain1.com and domain2.com – to the same registrar and set them up in the same way?
Thanks for any guidance.
- Paul
I have detailed instructions for setting up WordPress multi-site on a shared hosting account (even if you are installing WordPress on an account where you already have websites): changes for your hosting provider to make, wildcard DNS, WordPress multi-site configuration, installing the Domain Mapping plugin.
See WordPress 3 Multi-Site Installation, Even with Existing Web Sites, just updated for the WP3.3 menu names.
This is new for me. I set up my main root multisite, mysiteroot.com. It is a multisite and seems to be working fine. I have other domains that I want to setup as wordpress sites super administrated through mysiteroot.com. I followed your instructions and everything seems to be working. I have exactly what I need without knowing how to use it. So, how does this work now?
1) I have mysite2.com, at godaddy, and it is a subdirectory to mysiteroot.com. When I go to mysite2.com site through my broweser I get a 403 forbidden… I do not see a new wordpress site.
2) Simply put, how do I create my 2nd multisite up and running? Do I add a site in multisite first, (if I do that I get invalid address). Do I create a domain map using the cname of mysite2.com? I did that and get the 403 when I go to mysite2.com through my browser.
Have a great day.
Many thanks, everything works ok!
hello,
i need someone expert in this “Multisite Domain Mapping” plugin to implement it in my site
i have a wordpress system where every post need to be redirected to a different domain
skype “modelim” info@ibr.co.il
thanks
ran
[...] http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/ [...]
[...] of the tutorial that I learnt from to set up “domain mapping”. Please check the WordPress Multisite Domain Mapping Tutorial by Otto.Problems? Questions? Requests?So, how did it go for you? Did you get it set up [...]
Thank you so much for making this so simple to follow! I’ve read many, many different articles about how to do this correctly and I was just lost! Thanks to you I’ve got it figured out and working perfectly =)
Domain Mapping settings page when I click “Permanent redirect (better for your blogger’s pagerank)” and hit save it just reloads without applying the changes. As a matter a fact if I check or uncheck and hit save it will not apply those changes. By default options 1,3,4 are checked and I am unable to change this. thoughts?
Hi Daniel,
I am facing the same situation. Any help will be highly appreciated.
Also when I add new site with sub-domain, its adds the site and I can visit the site ( without any theme attached to it). But when I go to the dashboard, it simply gives this error on the browser:
Not Found
The requested URL /wp-admin/ was not found on this server.
Apache/2.2 Server at ixaweb.ixa.co.in Port 80
I don’t know if I am yet to make some configuration. Please help.
Ashish
seems to be fixed for me. I upgraded the plugin. here is more about the issue. http://wordpress.org/support/topic/plugin-wordpress-mu-domain-mapping-setting-changes-dont-stick?replies=9
[...] So, I undid everything and started from scratch. First I made sure I followed the instructions very carefully laid out on this fabulous tutorial about the domain mapping plugin. [...]
[...] This plugin allows users to use their own domain names on your Multisite network. This plugin does require a knowledge of adding and editing plugin files and a basic understanding of how servers work and your specific server settings. A great tutorial for setting up this plugin can be found on Otto’s blog, “WordPress 3.0 Multisite Domain Mapping Tutorial“. [...]
[...] settings. A great tutorial for setting up this plugin can be found on Otto’s blog, “WordPress 3.0 Multisite Domain Mapping Tutorial“.Multisite User ManagementThis plugin allows admins to set the default role of each, [...]
[...] This plugin allows users to use their own domain names on your Multisite network. This plugin does require a knowledge of adding and editing plugin files and a basic understanding of how servers work and your specific server settings. A great tutorial for setting up this plugin can be found on Otto’s blog, “WordPress 3.0 Multisite Domain Mapping Tutorial“. [...]
[...] This plugin allows users to use their own domain names on your Multisite network. This plugin does require a knowledge of adding and editing plugin files and a basic understanding of how servers work and your specific server settings. A great tutorial for setting up this plugin can be found on Otto’s blog, “WordPress 3.0 Multisite Domain Mapping Tutorial“. [...]
[...] This plugin allows users to use their own domain names on your Multisite network. This plugin does require a knowledge of adding and editing plugin files and a basic understanding of how servers work and your specific server settings. A great tutorial for setting up this plugin can be found on Otto’s blog, “WordPress 3.0 Multisite Domain Mapping Tutorial“. [...]
[...] http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/ [...]
[...] mapping of full domains to their network counterpart? Do check out the great ‘Tech Ninja’ Otto’s guide on doing that. Milan Petrovic’s GD Press Tools Pro does indeed supports multi sites backups [...]