Domain Mapping for Entire Multisite Network

I have a project where I need the original URL for a multisite network to be This is because I have a wildcard SSL for and want all logins and admin to use that domain as well as the site needs to be up and running and operational prior to the customer moving their domain to the network.

There will be sub-sites such as,, etc.

I need to map a domain to the network, so that the primary site and all sub-sites use the mapped domain for the front end of the website. For example... > > >

I am not having any luck finding a solution to this so far. At this point I think I am going to be writing my own plugin and sunrise.php to make it happen. But I wanted to put this out there and see if anyone has any other suggestions before I go that route.


  • alex
    • WPMU DEV Initiate

    Hey Joshua,

    This may help. It's how I fixed a similar issue. I don't know what hosting you're running so don't know how valid this is, but it's worth at least saying.

    Contact your hosting company and have them set your hosting account's primary domain to instead of

    Because you have already setup WPMU, your install should be fine. Like Predrag said;

    You won't be able to map a domain to the main site, only subsites can be mapped domains.
    but you'll have got around this because you're running which can be mapped.

    Wherever you installed WPMU, in public_html or public_html/ make sure that your subdomain wildcard is pointing to the correct directory. If you're just using and /site1 and /site2 then I don't see why you would need a subdomain wildcard, but anyways.

    Use the Domain Mapping plugin to map to

    When you do this all the /site1 and /site2 redirects should fall in place automatically. If not, you might need to put in a mod_rewrite into your htaccess file to pass through the requests.

    As far as I'm aware, the Domain Mapping plugin cannot map domains to subdirectory sites, so you can't have mapped to but from my understanding you aren't trying to do that. > is easy > >
    should automagically happen.

    Having as the primary domain on your hosting server and therefor residing in /public_html/ should be conducive to this. If its dug down in a sub-directory I think it will be more difficult. actually becomes an addon domain to and just setup a DNS CNAME to take care of that. Otherwise, htaccess...

    That should work. Note: You will need to have a dedicated IP address and if you are on shared hosting you must ensure that your IP resolves to your site and not the hosting companys 'default' page. Test this by whacking in the IP and if your website shows up all good, if the hosting companys page shows up whoops.

    A good hosting company with good support should be able to do this for you, especially if your running a big enough account (which if you're wildcard SSL'ing I imagine you are).

    I did this but I had the hosting company flip the primary domain of the account before I installed multisite, therefore I think you might have an issue with not thinking it's the multi-site network. But you should be able to get around this by pointing it to's subdirectory, or by "installing" multisite on as in copying the code into it's htaccess.

    It's a masking tape setup. You're other option is the multi-site in multi-site plugin. Setup as a multisite, then give it 1 subdomain site and set that up as multi-site, and run everything out of that. Use the domain mapping plugin to loop back to


    hosting account primary domain correct
    primary domain multi-site setup and htaccess code in
    subdomains correct url
    subdomains correct directory
    dns a records correct
    dns cname records correct
    subdomains multi-site setup and htaccess code in
    domain mapping plugin installed and configured correctly
    htaccess configured with any custom rewrites

    Final Note: When I did this, when I put in the domain name into the domain mapping plugin, it would come up red "error, couldn't map !bad!" BUT it did in fact work. Even though it was saying it wasn't, my testing and the fact the site is all working proves different. So just because it shows up the red error in the plugin interface in wordpress dashboard does NOT mean it's not working.

    Always double check with multiple browsers, make sure your dns is correct, flush it on your client pc's for testing etc.

    Final Idea:

    There is a custom login dashboard plugin that you could configure to detect the username the person types in and have it redirect to the subdomains/subdirectories site and I'm sure you could mask the URL if that was completely essential. An iframe could do it, with a piece of custom code on each logins dashboard to exit the iframe and reopen the page in the browser (it would have the cached credential). There's a plugin that can put stuff on all users dashboards in an instant you could use for embedding that.

    That's all I got. I hope it was helpful. Good luck.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.