This question already has an answer here:

I have around 6-7 DOMAINS hosted on linode server where apache is a webserver. One domain is ssl configured and other runs on http only.

Suppose https://www.example.com is ssl configured . others are


What would be the dynamic rule if someone put https://www.example1.com or others get redirect to http://www.example1.com and so on

like in virtalhost something like

  <If "%{HTTP_HOST} != 'example.com'">
     Redirect permanent / http://%{HTTP_HOST}/

above written hack doesn't work . any help?

marked as duplicate by Jenny D says Reinstate Monica, RolandoMySQLDBA, Michael Lowman, Scott Pack, Hyppy Feb 3 '15 at 20:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


That is simply not workable because Apache can't serve (at least without a lot of tricks), different certificate for different domains. So in reality, you will not get HTTPS requests on the other non-HTTPS domains because the user will be presented with a warning that the certificate is invalid - and that is, only if you configure Apache to even respond to those requests.

You should just configure Apache to not even respond to HTTPS requests to the non-HTTPS domains.

Not the answer you're looking for? Browse other questions tagged or ask your own question.