htaccess to escape percent (%) from URL
URL中包含百分号,会向浏览器返回错误的请求(错误400)。 我的文件名带有百分号(%),位于服务器上。
原始文件名:
204153_20090605_Aluminiumacetotartraat_DCB_oordruppels_1,2%.pdf
单击下载链接后在浏览器中的网址:
http://www.example.com/204153_20090605_Aluminiumacetotartraat_DCB_oordruppels_1%2C2%25.pdf
这将返回400错误且请求错误。 我正在使用Kohana 3。
现有的.htaccess文件内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | RewriteEngine On RewriteBase / <Files .*> Order Deny,Allow Deny From All </Files> RewriteRule ^(?:application|modules|system)\\b.* index.php/$0 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT] |
尝试使用B标志,确保由mod_rewrite取消转义为
1 | RewriteRule .* index.php/$0 [PTB] |