I have bought an SSL certificate which is valid only for domain.com and http://www.domain.com. Unfortunately there are a number of links out their beyond my control which point to m.domain.com. As the certificate is not valid for subdomains they are seeing an invalid certificate popup.
What is the best way to rewrite https://m.domain.com URLs so that they point to https://domain.com? (please notice it is only necessary to do this for httpS)
I have tried the following with no success:
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^m\.domain\.com [NC]
RewriteRule (.*) http://domain.com/$1 [R=301,L]
Apparently it cannot be done…