I have a main domain and a couple of secondary domains hosted by a commercial web hosting service using Apache servers. Each domain has its own .htaccess
file. I have only one SSL certificate, which is all I need, for the main domain.
However, if I type in the URL box (or a search engine directs to) HTTPS://secondarydomain.com
, I get the web page warning about an invalid security certificate. When I confirm the exception, the browser displays the maindomain that is bound to the certificate. I read the post: SSL priority. Is there nothing at all that I can do in this scenario to redirect from HTTPS to HTTP for the secondary domains?
EDIT for clarification: I want the server to apply SSL certificate only to the main domain. The sub-domains are wholly unrelated domains. It is only confusing to people visiting those sub-domains to see a SSL certificate with the name of an unrelated website. That is why I was hoping there was something I could put in the .htaccess files of those subdomains to make the server bypass or ignore the SSL certificate of the main domain.
EDIT: I also tried an unconditional redirect with these lines in .htaccess
RewriteEngine on
Redirect / "http://m y d o m a i n .com/"