0

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

http://www.example1.com 
http://www.example2.com
http://www.example3.com       
http://www.example4.com    

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}/
 </If>

above written hack doesn't work . any help?

1 Answers1

0

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.

ETL
  • 6,691
  • 1
  • 32
  • 49