2014-03-27 79 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] 
相關問題