htaccess从URL中转义百分比(%)

时间:2010-10-22 12:24:07

标签: .htaccess kohana-3

在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文件内容如下:

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] 

1 个答案:

答案 0 :(得分:1)

尝试使用B flag,确保mod_rewrite转换为%25的{​​{1}}在插回目标路径后重新转发回%

%25
相关问题