Php 添加查询字符串后,htaccess不工作
我的网址是:Php 添加查询字符串后,htaccess不工作,php,regex,.htaccess,Php,Regex,.htaccess,我的网址是: http://example.com/test (base url) 我想把这个转变为: https://example.com/tset 如果URL为: http://example.com/test/login?redirect= 我把它改为: https://example.com/test/login?redirect= 如果我的URL是: http://example.com/test/login 我想把它移到: https://example.com/te
http://example.com/test (base url)
我想把这个转变为:
https://example.com/tset
如果URL为:
http://example.com/test/login?redirect=
我把它改为:
https://example.com/test/login?redirect=
如果我的URL是:
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.您能显示您尝试的规则吗?RewriteCond%{HTTP_HOST}^bt.example.com/test/(.*)[NC]RewriteRule[R,L]实际上无法使用此规则,因为我已将另一个站点指向同一文件夹。如果我应用此规则,则它将在两个站点上都起作用。这就是为什么我需要站点特定的会话和规则