2016-04-07 21 views
1

我用这个重定向代码.htaccess强制所有地址使用HTTPS在一个页面上:力HTTP当其他网页forcet到HTTPS

RewriteEngine On 

RewriteCond %{HTTPS} off 
RewriteRule (.*) https://Domain.com%{REQUEST_URI} [L,R=301,NC] 

RewriteCond %{HTTP_HOST} ^www.Domain.com [NC] 
RewriteRule (.*) https://Domain.com%{REQUEST_URI} [L,R=301,NC] 

我想一个解决方案,迫使只有一个像domain.com/example页只使用http而不是强制使用https。 我如何修改重定向代码?

非常感谢

回答

0

要exclule从HTTPS重定向页面,则可以使用:

RewriteEngine On 

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