I've got mydomain.com
*.conf folder contains a few .conf files for subdomains and some virtual domains such as myotherdomain.com
I want all requests to http mydomain.com to get redirected to https mydomain.com
So I have this:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
That works, but http myotherdomain.com gets redirected to https myotherdomain.com I'd like to keep myotherdomain.com not get redirected to https.
So with some help from stackoverflow yesterday, I changed my file to:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !myotherdomain\.com
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
The existing sites all work just fine. The problem I have now is that http myotherdomain.com doesn't get served properly -- it's as if it is ignoring myotherdomain.conf:
<VirtualHost *:80>
DocumentRoot /home/webadmin/myotherdomain.com/html
ServerName myotherdomain.com
ServerAlias "www.myotherdomain.com"
<Directory /home/webadmin/myotherdomain.com/html>
Options Includes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
Thoughts?