mardi 28 avril 2015

How do I ignore .htaccess on subdomain?

I would like to force HTTPS unless we are using the subdomain: foo.domain.com. When I open that subdomain in my browser's incognito mode, it works. The HTTPS isn't added. When I open that subdomain on my browser in normal mode, I get an error that says: "Your connection is not private". I can see that the URL on my browser now reads: https://foo.domain.com. Clearing my browser's cache doesn't seem to fix it.

RewriteBase /

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^foo\. [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Thanks!

Aucun commentaire:

Enregistrer un commentaire