Force https except for one directory

2019-02-20 19:20发布

I'm using the following .htaccess file to force any page request to https://

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

How could I force https for all directories/pages except the directory "/domain" ?

I can change the main htacces or create a new one in the /domain directory, the easy way, but how?

1条回答
beautiful°
2楼-- · 2019-02-20 19:36

This should get what you need.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !domain [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
查看更多
登录 后发表回答