我试图强迫非HTTPS访问者使用HTTPS,请参阅下面的代码
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/%$1 [R,L]它将example.com重定向到https://example.com/index.php,我只想让example.com重定向到https://example.com
请帮帮忙。
发布于 2016-11-18 13:49:36
颠倒顺序:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]https://stackoverflow.com/questions/40678179
复制相似问题