2014-03-27 84 views
0

我正在使用htaccess将某些页面重定向到htaccess。我使用的代码是.htaccess控制某些页面上的HTTPS

RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_URI} /core/marketing/editprofile 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L] 

该页面重定向为/core/marketing/editprofile,但它并不重定向回HTTP为在此之后其他页面。

请告诉我,我可以启用HTTPS的http重定向吗?

回答

0

您必须为其他页面做相反:

RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_URI} /core/marketing/editprofile 
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

RewriteCond %{HTTPS} on 
RewriteCond %{REQUEST_URI} !/core/marketing/editprofile 
RewriteRule^http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
相关问题