我的网址是:
http://example.com/test (base url)
我想把它移到:
https://example.com/tset
如果网址是:
http://example.com/test/login?redirect=
我把它改成:
https://example.com/test/login?redirect=
如果我的网址是:
http://example.com/test/login
我想将其移动到:
https://example.com/test/login
您可以将此规则用作站点根目录 .htaccess 中的第一个规则:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^bt. [NC]
RewriteCond %{HTTPS} !on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
查询字符串会自动传递到https://....
URL。