我使用这个代码
RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
将所有请求redirect到HTTPS,这是没问题的。
现在我想要除了一个文件index810.php以外的其他东西
当我这样写
RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !^ index810.php RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
我得到太多的redirect,任何build议。
先谢谢你
解决方案是使用非重写规则:
# do nothing for /index810.php RewriteRule ^index810\.php$ - [L] # else ... RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}
你的模式是错误的:
=/index810.php
) 接受的答案不适合我。 但是,
RewriteCond %{THE_REQUEST} !/index810\.php [NC] RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}