Please note that as of August 11, 2008, Donncha has released a domain mapping plugin that makes this process easier at the cost of creating subdomains off the newly mapped domains. On the other hand, the XML-RPC continues to work.
Introduction
WordPress has been absolutely amazing. It has grown from merely being a blogging platform to more of a CMS/blog platform now. With WordPress Mu (Multi-User), it takes WordPress to a whole new level by allowing for multiple instances of WordPress on one install with one database! The best example of WordPress Mu in use is WordPress.com.
A new feature that was introduced on WordPress.com is domain mapping. Currently when a user visits a WordPress Mu installed site (depending on if the install is subdomain or subdirectory), and signs up for a new blog, the url is http://subdomain.domain.tld/. What domain mapping allows is for a user with a registered domain name to park it on their site at http://subdomain.domain.tld/.
What is the advantage of being able to do this? Well for me, it’s quite advantageous. Since I run multiple WordPress sites, instead of having to download WordPress, upload it, configure it, etc., I can create a new subdomain blog on my main site and then use domain mapping to make the subdomain appear as it’s own domain site. This allows me to share the user tables, themes, plugins, etc. thereby saving space, have only one database to backup and so on.
Unfortunately there is no easy and quick way to do domain mapping with WordPress Mu (yet). There are a few threads on WordPress Mu’s support forum on how to do it, but I figured I’ll make a clear and precise directions on how to achieve domain mapping. Much of the directions I use are from drmike’s thread at the WordPress Mu support forums.
Prerequisites
Before you can use domain mapping on WordPress Mu, there are certain criteria that your WordPress install must meet.
- It must be a WordPress Mu install and not a WordPress install and it has to be working correctly.
- The WordPress Mu install must utilize SUBDOMAIN and not subdirectory feature.
- You must already have a domain name registered that you wish to use.
Please note that while it is not impossible to do domain mapping on hosted websites, it will be much more easy and worthwhile to have at least a virtual private server (VPS) or dedicated server, or you will have to contact your host each time you wish to add another domain to your WordPress Mu install. The instructions I present are based on a person with a VPS.
Disclaimer
I provide these directions for my own reference and for other people who are interested. Use all or any part of this guide at YOUR OWN RISK. I take no responsibility for what may happen by following this guide. Always remember to make backups of your database before making any drastic changes FIRST!!!
Instructions
- Login into your domain name registrar, and edit the nameservers to match your WordPress Mu domain nameservers. Most registrars will let you do this yourself, but in some rare cases, you may have to contact them. This process can take anywhere from 10 minutes (if it is a newly created domain name) to 24-48 hours to resolve correctly.
- Login into you main site’s cpanel and select PARKED DOMAINS.

- Under “New Domain Name:”, enter the registered domain name that you want to do domain mapping with minus “www” prefix. In my case, I want to domain map http://www.abunchofcars.com, so I enter abunchofcars.com into the field. Click “Add Domain!”

- You should get something to this effect:
Parked Domain Additions Using nameservers with the following IPs: 216.246.58.57,216.246.58.58 Bind reconfiguring on vps using rndc Created DNS entry for abunchofcars.com abunchofcars.com was successfully parked on top of bui4ever.com
If you get an error, it usually means that the nameservers have not resolved fully yet and you will have to wait a bit longer before continuing to this step.

- Once the domain name has been parked, login into your web host manager (WHM), usually located at http://domain.tld/whm/.
- Scroll down the left hand list until you find the category, “DNS Functions”. Click on “Edit DNS Zone” and select the parked domain name and click “Edit”.

- Inside you’ll find a bunch of things. What we are looking for is under Domain your parked domain name, TTL of 14400, Record Type of A and next to it an IP address. We want to copy that entire IP address.

- Scroll all the way down to where you see “Add New Entries Below this Line”, we need to create a new entry.
- This is what you should type in there: *, 14400, A, 216.246.58.46, obviously changing my information to your information.

- Click “Go” and you should get a “Zone Modified!” message.

- You will need to restart apache for this to take effect. If you have a VPS or dedicated server:
httpd restart
in a command line should do the trick.
- Now login as Admin to your WordPress Mu site.
- Under “Site Admin” > “Blogs” > “Add Blog”, create a new blog naming it anything you want for now. Test to make it sure it works.
- Once the new blog has been created, go back to “Site Admin” > “Blogs”, find the newly created blog and select “Edit”.


- There are four places we need to make changes at. Under URL, you will see http://abunchofcars.bui4ever.com/, change that to http://abunchofcars.com/. Look for Siteurl, Home, and Fileupload Url and make the same changes as you did with Url, but leaving the suffix of “files” at the end of the Fileupload Url. Please note that it is very important that if the address has a trailing slash, you also include the trailing slash.




- Click “Update Options”, once it’s done, you’ll be returned to “Blogs” and notice that the newly created blog no longer is in the list.
- Before we can access the newly created blog, we need to make some changes in the MySQL database. Login to your CPANEL and PHPMYADMIN (I highly recommend you get the PHPMyAdmin plugin so you don’t have to always login to CPANEL to access PHPMYADMIN).
- Select the correct database from the drop down under “Database”.
- On the left hand side, scroll down until you see “wp_blogs”. Click on it and it should open in the right hand side. Click on “Browse” in the menu.


- Scroll down and you will see a list of all the blogs that have been registered. At the very end of the list, you should see abunchofcars.com under “Domain”. Click the pencil icon to edit that entry.

- Once it finishes loading, we want to change “site_id”’s value to be the same as “blog_id”. For me, abunchofcars.com’s blog_id is 25, so I change site_id 1 to 25, and click “Go”. What this does is remove bui4ever.com (site_id 1) as the “blog owner” and make abunchofcars.com its own blog owner. Also you should remember the blog_id, as you will need it for the next few steps.

- On the left hand side, scroll down until you see “wp_site”. Click on it and it should open in the right hand side. Click on “Browse” in the menu.

- You should see one entry for your main blog. What we need to do is add an entry for abunchofcars.com. Click on “Insert” and we need to populate three values.

- For “id”, we enter the blog_id, in my case, 25. For “domain”, we enter the domain address, so I enter abunchofcars.com. And finally for path, we just put a forward slash (/). Click “Go”.

- So when you go back to wp_site and click “Browser”, you see your new entry.
- On the left hand side, scroll down until you see “wp_sitemeta”. Click on it and it should open in the right hand side. Click on “Browse” in the menu.
- We need to duplicate the contents of “meta_id” 6, the site_admins. Click on the pencil to edit it.

- In the “meta_value” field, you will see a big box with an entry:
a:1:{i:0;s:5:"admin";}Copy in its entirety.
- Click back on wp_sitemeta, and select “Browse”. Go to the very last entry, and make note of the “meta_id” number. Now click “Insert”.
- We need to make entries now, under “meta_id”, enter the next consecutive from the number you made note of in Step 27. In my case, the last entry was 64, so I will be using 65. The “site_id” you use is from Step 19, so I will enter 25. The “meta_key” is site_admins. In the big field under “meta_value”, paste the weird string we copied in Step 26. Click “Go”.

- We need to duplicate another entry, click wp_sitemeta and “Insert”. For “meta_id”, we need to use the next consecutive number. Under “site_id”, we use the same number from Step 19. For “meta_key”, enter site_name. In “meta_value”, enter in your parked domain address. In my case, I would enter abunchofcars.com. Click “Go”.

- The final entry that needs to be duplicated is “illegal_names”. So go back to wp_sitemeta, and click “Insert”. For “meta_id”, it needs to be the next consecutive number from what was used in Step 29. For “site_id”, enter the site_id from Step 19. The “meta_key” is illegal_names and the “meta_value” entry is
a:7:{i:0;s:3:"www";i:1;s:3:"web";i:2;s:4:"root";i:3;s:5:"admin";i:4;s:4:"main";i:5;s:6:"invite";i:6;s:13:"administrator";} - Now we should be good to go for testing. Open a web browser and enter in your parked domain address, I enter http://abunchofcars.com and you should see a newly created WordPress blog. If you don’t, a mistake was made somewhere.

- The next step is test login. Try your admin login and you should get in fine. Please note, if you type http://abunchofcars.com/wp-admin it will redirect you to your main site’s site admin. It is very important that you include a trailing slash after wp-admin, so http://abunchofcars.com/wp-admin/. Hopefully this issue will be resolved in the near future.
- Now another cool feature of the domain mapping, is that you can also create subdomain blogs off of the newly mapped domain. I can create http://how-to.abunchofcars.com and users can also sign up for their own blogs as they do on the main site. Cool huh?
Popularity: 63% [?]
If you liked this post then consider subscribing to our full feed RSS. You could also subscribe to our email feed and have new posts sent directly to your inbox.
Have you checked out this plugin to help with managing domains on mu?
http://wpmudev.org/project/Multi-Site-Manager
Hrmmm, I just noticed it was recently updated. I tried it before and it didn’t seem to *work* for me.
But I’ll give it a go again and update if it does work. Thanks!
(7:15pm) Ok, just installed the plugin and it seems to be great! I don’t have another domain to try just yet, but if works like it should, Steps 12-32 will no longer be necessary! I’ll probably leave the directions up for whatever and make some slight changes to reflect this plugin.
Ok, I tried the Multi-Site-Manager plugin and there are some issues.
It doesn’t duplicate the site_admins in Step 30. So when you first login, you have no Site Admin and you get a nice message that says permission denied.
It doesn’t duplicate the allowed_themes and thus you get this error when you try to change the theme: “Fatal error: Cannot break/continue 1 level in /var/www/blogdomain.com/wp-admin/admin-db.php on line 669.”
Those are the two major problems so far, otherwise a great plugin.
So basically you shouldn’t use the plug in or are there fixes for this.
Nice work!! Can’t wait to set this up! Many thanks!!
@kevin: it depends. The plugin offers a nice user interface and does remove a *few* steps, but you do have to go back into the database to check if it did all the steps correctly. I’m still using it for just whatever, but it probably is quicker to forgo the plugin and do it all manually or until the plugin has these issues resolved.
@matt: no prob! Let us know how it goes!
Would this set up allow people to register a blog on the subdomain abunchofcars.com?
Matt, yes sir. That’s the beauty of it. You could have 6 domains and utilize the subdomain feature for each one! Go ahead and try it if you like.
One more question. I have a bbpress integrated on my main site. If a user registers for a blog on say abunchofcars.com with the username/blog carfreak.abunchofcars.com will this prevent people from registers the username and blogname carfreak on the other domains and allow that user to post on the main sites forum?
Or will I need to do some customization?
Matt,
That’s a good question actually. If you have the WordPress integration plugin for BBPress, that theoretically should sync up any signups from WP and/or BBPress. So in theory, once the username carfreak has been used, it shouldn’t allow any other sites to signup with the same username. There is only one way to test. I have BBPress on this site also, why don’t you try signing up to the abunchofcars.com site with carfreak and see if works signing up here as carfreak too?
I followed the instructions, not using the plug-in, everything comes up fine except I am getting this error when I go into the themes of my new domain:
Fatal error: Cannot break/continue 1 level in /home/pointles/public_html/wp-admin/admin-db.php on line 690
I am going through to check my tables in php and go over the instructions but thus far everything looks correct.
Instructions need to be inserted to copy the allowed themes table, that is what I messed up on! Otherwise this is perfect!
Thanks again for putting this together
Kevin, reference my comment here: http://bui4ever.com/web-itecture/wordpress_mu_with_domain_mapping/#comment-2869
I need to add it into the list of directions. I didn’t because I was hoping the plugin was going to resolve all the issues.
Hello Richard,
First of all, I have to thank you so much for coming up with this tutorial. I am having problems with it though. I did everything you said but when I go to “http://mysite.com” I am automatically redirected to “http://mysite.com/wp-signup.php” and it gives me an error that says:
The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
* This problem can sometimes be caused by disabling or refusing to accept
cookies.
Do you have any idea of what it could be or what I did? Could it be that for “Site URL” I put “mysite.com/” ?
Has anyone done this successfully through Site5 hosting? I can’t wait to actually get this to work for me. Thanks so much for your help!
-Janine
Janine,
Thank you! I’ve had that redirect error before. Try removing the trailing slash after mysite.com in Site URL and see what happens.
I would go back again through the WP database to make sure that everything was added correctly. I’m trying to remember how I fixed it the last time I got this error.
I got to say thanks for this great post and great tutorial.
Just wanted to say thanks for this write up. AWESOME STUFF!!!
No problem!!
Hello again Richard!
Well, I finally got the chance to redo it and the problem was that I put a trailing slash after the URL. Now, it works perfectly! All I needed to do was insert allowedthemes. Thank you so much for this! You have no idea how long I have been trying to find something like this. Thank you!
Richard,
Just set up a bunch of domains using it without a single problem. Thanks for putting together such a good tutorial.
Janine,
Great! That’s a nice theme, what is it called?
Matt,
Well, the majority of the credit is owed to Dr. Mike, I just merely put all the information in one place and added pictures.
Hi Richard,
Great tutorial man, but my host doesnt allow wildcard DNS
Can you people share which host do you people use. May be u can send me a mail in case u dont want to put the list here.
regards.
I’m getting the following error when i try to view presentation on the backend.
Fatal error: Cannot break/continue 1 level in /home/freakin/public_html/wp-admin/admin-db.php on line 690
Anyclues??
Matt: please reference comment #3…you have to duplicate the allowed_themes.
Looked at comment three. Where do I duplicate the allowed_themes? Do I just create a copy in the themes folder for each domain? Thanks!
Matt: sorry, I should be clearer, login into the MySQL database and go under wp_site and look for a allowed_themes entry, go into that and copy the entries and do an insert. It’s the *same* procedure as Step 31, but instead of site_name, it is allowed_themes that you gotta duplicate.
I’ll be updating the directions shortly to reflect these changes.
Hi Richard, was waiting for ur messg regarding the webhosts that allow wildcard DNS to host wpmu.
I use Autica (which is owned by MidPhase). The easiest way to have wildcards is either to have a VPS (which I have) or a dedicated server. In many cases, shared web hosting accounts will not allow for wildcard DNS.
If you like, I can also sell you some space, you’ll get your own CPanel and what not and I’ll setup the wildcard DNS for you.
Thanks Richard. Can you let me know what would I need to pay for that and how much space would I get. I need to setup around 40 domains using WPMU.
Manish, email sent.
Richard,
I have some plugins that are displaying new posts, recent comments etc..They are acting really strange give. In particular the fimii plugin displaying new members and recently updated blogs. Could this be due to the domain mapping? Any way to fix or get around it?
Matt,
Without a link to the problem in question, I can’t really tell.
Is there anyway to make it work in subdirectory format. Pls refer to David’s recent remark on http://wpmudev.org/project/Multi-Site-Manager/#project_bottom
He says “you should be alright with subdirectories. “
Manish,
In theory it should work, but I think Dr.Mike had mentioned something about it not working. I personally don’t see why not, but I have not tried it.
Still working on getting the themes to work. Followed the directions, looked for the theme file in wp_site. Could not find it there are only three entries. Am I missing something?
Matt, try looking for allowed_themes or allowedthemes.
ok!! found both allowed_themes and allowedthemes. So I make a copy referencing the site id of the corresponding domain? Do i need to make copies for both allowed_themes and allowedthemes?
Really appreciate all your help!
Matt
Matt,
For each site_id, there should be an allowedthemes.
You could just dupe both, but either one will be fine.
Can I use this tutorial to redirect a third level subdomain into a second one of the same main domain?
I have installed WPMU in blogs.domain.tld because I don’t want to mess files in domain.tld with my other CMS (installing in root domain is not an option) When new blogs are created they got this url pattern: blogsname.blogs.domain.tld Is there any way to make the url look like this: username.domain.tld?
Thank you in anticipation
In theory it should work. Your current domain is blogsname.blogs.domain.tld. I’m pretty *sure* blogsname.domain2.tld will work, but you probably want the original domain name to appear.
So try this, create another blog: test.blog.domain.tld. Follow Steps 14-35 and put test.domain.tld in wp_site and all the places you are supposed to *fix* the domain urls. Report back on whether it works on not.
Thanks Richard,
My main problem is that I’m stuck at the very begining, in step #24 What would my main domain and path be?
domain: domain.tld
path: blogs/domain.tld?
if so, I’m afraid it doesn’t work, because it displays the content of domain.tld instead.
I may have done it wrong…
domain: blognames.domain.tld
path: /
I have a stupid question but where exactly should I be installing the David Dean’s multi-site plugin? Which directory? And when should I install it - during the MU installation, or after Mu has been installed?
Andrew,
You stick the multi-site plugin into the wp-content/mu-plugins directory after WordPress MU has been installed. There is no need to activate. Once that is done, under Site Admin, you will see another option: Sites.
I have a problem when users try to register. Instead of using the domain it puts the actual url as domain.tld (ex:test.domain.tld) thats the actual url being displayed and used. I’m sure I just missed a step and didn’t put in the url.
Any idea what I missed or need to change? Other than that they are functioning perfectly.
Any idea why /wp-admin/themes.php doesn’t show?
Matt, I’ve had this problem before. Haven’t had a chance to look into it yet. It might be related to the trailing slash problem. For example, when you try to access newmappeddomain.tld/wp-admin it resolves back to mainmudomain.tld’s wp-admin, but if you enter newmappeddomain.tld/wp-admin/ it will take you into the new mapped domain’s wp-admin.
Jacob, what do you mean themes.php doesn’t show up? It shows up fine for me and all the mapped domains. It might be a plugin issue or a bad install…?
Richard,
Any recommendations on where to go or who to talk with to figure out how to fix this? I’m supposed to launch in two weeks. Any help is much appreciated.
Thanks,
-Matt
Figured out why I was getting the domain.tld as the address of new blogs. The site wide tags plugin was doing it for some reason. Removed it and the problem stopped.
DNS wildcard for the parked domain seems to resolve the inability to access the blogs created on parked domains. However still having problems, when someone tries to log onto their blog on a parked domain it just reloads the login screen.
-Matt
Matt,
Glad to hear one problem is resolved! Which site wide tags solution were you using?
Checks Steps 19-27 cause it sounds like a cookie issue. Let me know how that goes.
Rich
Rich,
Checked it twice. steps 19-27 were done correctly.
Any other ideas?
Matt,
Sorry, I can’t think of anything else. Definitely let me know if you find something out.
Rich
Matt,
Give this a try.
Rich
Hi,
Your documentation here is great and I’ve found it really helpful.
I’m having a redirection issue with a subdomain I set up. Basically when I try to login to sub.domain.com/wp-admin I get redirected to domain.com/wp-admin.
More info here:
http://mu.wordpress.org/forums/topic.php?id=6203&page&replies=12#post-37483
Thought I’d post here in the hope you might be willing to provide some clues.
Thanks-
Shane.
PS: I hit the login page ok - its just when I enter my login and pass and hit enter it then redirects me (and logs me in) to the main site.
Shane
Shane,
You’re correct, it’s a redirection issue. You have to add the trailing slash at the end of wp-admin for any mapped domains! For example: site.com/wp-admin/.
Please read Step 34.
Hi,
Thanks for this Richard. I did read all your instructions (many times!). The problem wasn’t the trailing slash for me. I have fixed the issue now. For the record:
In the Mu mySQL, in table wp_12_options, I needed to change the value wp_user_roles to wp_12_user_roles (problem carried over from an WP table import). I also copied the users data from the orignal Mu install table over the the imported table. (Note: my blog ID = 12 for my new Mu table).
I’m still having some issues and will continue to compare the WP and WPMu tables to figure it.
Thanks for responding.
Shane.
When you say “Please note that while it is not impossible to do domain mapping on hosted websites, it will be much more easy and worthwhile to have at least a virtual private server (VPS) or dedicated server, or you will have to contact your host each time you wish to add another domain to your WordPress Mu install. The instructions I present are based on a person with a VPS.”
Which step do i need to contact my host regarding?
Is it in relation to step 12?
Thanks for the tutorial, very helpful and handy IF i can get it to work!
Ash,
You have to contact your host for Steps 5-11 every time you add a new parked domain.
If you have a ton of domain names, after awhile your host is going to get tired of doing this real quickly.
Rich
Hmm, strange i don’t have a VPS just a standard reseller account, but i can do steps 5 - 10 but not step 11, so presumably i need to ask my host to do this part.
I’m assuming if i add all my domains at once, they’d only need to do this again when / if i add additional domains?
Thanks
Ash,
I’m sorry, I didn’t know you had a reseller account. Yea with a reseller account you can do Steps 5-10, Step 11 is what your host needs to do. But actually in your WHM, you should have a httpd restart…I don’t remember exactly where it is, but it is there. If you find it, you won’t need to even ask your host.
Nice Site!
I’ve started playing with the Multi Site Manager plugin as of late on another WPMU install. It seems to be working pretty well and *may* negate the need for these directions. I’ll continue using the Multi Site Manager and see how that goes.
Hi,
I think i followed all instructions given above, everything went fine but when i tried the URL it gave me this error:
Forbidden
You don’t have permission to access / on this server.
Can anybody help?
Thanks
Great tutorial Richard… I just tried it and it works great.
I’m now wondering which of these steps could be skipped if all I want is to set up and run many different blogs under their own respective domains (i.e. blog1.com, blog2.com, etc,) but *without* the possibility to set up additional subdomain blogs on any of those domains (such as newblog.blog1.com, anotherblog.blog1.com).
awesomeness… thk u..
so I just went though the process.. I used the directory method instead of the subdomain… my question is do we lose the ability to track per account stats… meaning through cpanel i can nolonger see webalizer stats for each domain… they’re all together now… not ahuge deal cause i use analytics but would be nice if there was a way to get this working as well.. I do have root access to my vps box… any thoughts?
Yes, you lose the ability to track the stats because it’s a parked domain and doesn’t register like if it was it’s own self hosted domain.
The best bet is to use Analytics. I do find that other companies (Alexa and so forth) are able to independently track each domain even though the domains are all parked on one domain. Have you considered using Automattic’s WordPress Stat? I use that with good results.
Hi i follow all the steps and everything is working nicely,but! when i try to upload something im getting this error
Warning: Invalid argument supplied for foreach() in /home/webnet/public_html/wp-includes/functions.php on line 1115
This only happens with the blogs that are mapped. Any ideas?