SSL, Multi-Site, & Domain Mapping Issues

Currently we have a site that is setup on WordPress Multi-Site under a Multi-Domain SSL and using Domain Mapping to direct to the primary domains.

Apparently this doesn't work with domain mapping.

Any suggestions or alternatives?

  • Patrick

    Hi there @andpixels

    I hope you had a great weekend!

    If you are mapping domains to subsites in your network, and want the front-end of those subsites to be accessed via https, then I believe each of those domains would need its own SSL certificate.

    However, this thread appears to provide a different take on the issue:
    https://premium.wpmudev.org/forums/topic/official-verdict-ssl-and-multisite-domain-mapping

  • Sybre Waaijer

    Hello @andpixels and @Patrick

    If you're using cPanel or any other WAMP service, I'd suggest you'd install the certificate (multidomain or single) for each and every website it's based upon in the server. The apache/nginx/litespeed server will fetch the correct certificate upon each request.

    To force HTTP you'd need to add this code in the root's .htaccess (that is public_html, where your first index.php file is):

    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
    RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]
    
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^otherdomain\.com [NC]
    RewriteRule ^(.*)$ https://otherdomain.com/$1 [R=301,L]

    Repeat that code for each domain you want SSL for.

    If you're using SSL for your subdomains, assuming you have a wildcard certificate, use the following code too:

    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^(.*)\.yourdomain\.com [NC]
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    Leave all options in the Domain Mapping as default, do not force HTTPS in there, the .htaccess code above works much more efficient and trustworthy.

    Let me know if it's working for you :slight_smile: Have a great day!

    I'm going to transfer a few SSL domains into my MultiSite soon, if I find any bugs or issues I'll let you know with a workaround.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.