我想使用htaccess将我的会员注册网址重定向到HTTPS。所以: http://example.com/product/register/ *
......以及其下的任何页面,例如: http://example.com/product/register/details http://example.com/product/register/payment
我尝试了以下内容,但我不确定我是否走在正确的轨道上:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond $1 ^(register/*) [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
任何帮助表示感谢。
答案 0 :(得分:0)
这样做:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST} /product/register/ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]