I have a subdomain secure.domain.com and want it to be accessible through SSL only.
All the files for secure.domain.com are in the private_html, however I want to completely disable the option to login without SSL and redirect all non-ssl to the ssl-folder..
Using a php redirect script isn't possible, because I would need to put it in every subdir.
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}