I’m running a WordPress multisite network that allows users to optionally use a custom domain name on their websites. Users that opt not to use a custom domain are assigned a subdomain of the WP install (e.g.: fred.example.com, with example.com being the URL the WP multisite network is installed on).
I have a wildcard SSL configured for the main domain, but I do not have certificates available for custom domain names.
What I need is a htaccess rule to force traffic to https if the request is for either
*.example.com, but not if the request is coming in using a custom domain.
It should work as follows:
Read more here: .htaccess rule to force SSL on only certain domains