.htaccess可在某些页面上控制HTTPS
我正在使用htaccess将某些页面重定向到htaccess。我使用的代码是.htaccess可在某些页面上控制HTTPS,.htaccess,http,mod-rewrite,https,rewrite,.htaccess,Http,Mod Rewrite,Https,Rewrite,我正在使用htaccess将某些页面重定向到htaccess。我使用的代码是 RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} /core/marketing/editprofile RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L] 该页面正在重定向到/core/marketing/editprofile,但在此之后,其他页面不会重定向回http 请告诉我,我可以同时启用http
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} /core/marketing/editprofile
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
该页面正在重定向到/core/marketing/editprofile
,但在此之后,其他页面不会重定向回http
请告诉我,我可以同时启用https到http重定向吗?您必须对其他页面执行相反的操作:
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]