How to do domain mapping for WPMU subdom correctly?

Hi guys! I wonder how you are mapping your custom domains to existing subdomains with native built in wordpress mapping? As soon as I change the subdom address to the new domain it redirects to the main site of the multisite.

The documentation that I’ve found on this is all for using a domain mapping plugin or for cases were new server blocks for every new domain can be added.


According to what I see, it is not supported at v4

Ohh no… Were did you see this?

Domain mapping works. What doesn’t work is SSL with Let’s Encrypt: How to install Letsencrypt for domains on WP Multisite (subdom)?

It works for me, I was able to do this last night.

That’s great news! Would you mind sharing how you achieved this? Hopefully without a multidomain ssl certificate.

I just used what was already in the documentations:

ee site create --type=wp --mu=subdom --ssl=le --wildcard

You will need to add 2 TXT records in your DNS records, just follow the prompt.

Yes, thank you, this part I have covered. It is the action of the mapping of a custom domain name to a subdom that fails.

My problem is that after mapping both the mapped domain and the subdom redirect to the multisite primary domain. So I’m wondering how you guys are getting around this?

I’m guessing that since the custom domain lacks a cert then the server does a http->https redirect to the primary domain. I’m thinking that perhaps installing a self signed cert for the custom domain first before mapping it might help?

Then perhaps going with Cloudflare universal ssl. But would I CNAME the custom domain to the primary domain or have to add a new domain completely?


Can confirm this, custom domains for sub sites do not work.

This is weird, customized domains are now working in multisite.



Hi Cim, that’s great that you got it to work! I still can’t figure it out, it just does not map correctly.
I have a couple of questions.
In what order are you adding the custom domains. CF first and then changing the site address in WP?
Are you adding the custom domain with http or https in the wordpress dashboard?
Are you using the “flexible” SSL setting in CF?
Do you have a let’s encrypt wild card for the multisite to start with? If not then what certificate?

I had a non MU site made first, I don’t think it matters.

In CF, I just added CNAME with *, as shown in the screenshot.

You make a new site then change its subdomain to a custom one.

No, I always use Full.

Yes you will need a Lets Encrypt wildcard certificate as CloudFlare does not proxy wildcards in the free version. If your MU subdomain goes to the first site that was created then disable or delete that site. I think this is how I got it to work. It was a while back.

ee site create domain.tld --type=wp --mu=subdom --ssl=le --wildcard