我已成功将我的个人资料页面定向到 https,同时将其余页面保留在 http 中。我无法添加另一个页面以定向到 https,而不会导致无限循环。
The page I am trying to add the list to be directed to https is
"mywebsite.com.index.php?r=user/login".
RewriteEngine On
# Go to https
RewriteCond %{HTTPS} off
RewriteCond %{QUERY_STRING} ^r=user/profile$ [NC]
RewriteRule ^(index\.php)$ https://www.mywebsite.com/$1 [R,L]
# Go to http
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_REFERER} !/index\.php\?r=user/profile
RewriteCond %{REQUEST_URI} !^/index\.php$ [OR]
RewriteCond %{QUERY_STRING} !^r=user/profile$ [NC]
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R,L]