I have a CentOS 6.5 server running Apache 2, and hosting a number of sites. The config is via cpanel.
One of the sites has a SSL key with a redirect from HTTP to HTTPS. Other sites are all accessible via HTTP only. This is working fine.
However, if I try to access any non-SSL site using HTTPS, I get directed to the SSL site. I have tried adding
RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http://www.nonsslsite.com [R=301,L]
To the htaccess file for the non SSL sites, but this has no effect.
Any ideas how I can either redirect HTTPS requests for non SSL sites to a 404 error page, or just redirect to the HTTP site instead?