Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (?!^infos/)^(.+?)/?$ /test.php?f=$1 [L,QSA,NC]
如果我尝试访问http://www.example.com/test%test,此 htaccess 将返回错误 400
测试.php:
echo $_SERVER['QUERY_STRING'];
结果:
f=error/400.html
如何在 htaccess 中转义 % 符号?是否有任何其他字符会导致相同的问题?