Vla*_*vic 1 apache mod-rewrite
我用这个代码
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Run Code Online (Sandbox Code Playgroud)
将所有请求重定向到HTTPS,这没关系.
现在我想要同样的东西,除了一个文件index810.php
我这样写的时候
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^ index810.php
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Run Code Online (Sandbox Code Playgroud)
我得到太多的重定向,任何建议.
先感谢您
一个解决方案是使用非重写规则:
# do nothing for /index810.php
RewriteRule ^index810\.php$ - [L]
# else ...
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}
Run Code Online (Sandbox Code Playgroud)
你的模式错了:
=/index810.php
)