鍍金池/ 問(wèn)答/PHP  Python  Linux  網(wǎng)絡(luò)安全/ %85%AE使Apache的Rewriter失效???

%85%AE使Apache的Rewriter失效???

我在.htaccess文件里面添加了如下內(nèi)容:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

然后當(dāng)我輸入http://127.0.0.5/Style/main/本兮http://127.0.0.5/Style/main/%... )進(jìn)行訪問(wèn)時(shí),出現(xiàn)了apache自帶的404頁(yè)面,但把后面的“本兮”換成其他漢字時(shí)訪問(wèn)是正常的?。?!
經(jīng)過(guò)我的排查,發(fā)現(xiàn)只要訪問(wèn)所用的漢字的url編碼中含有“%85%AE”就會(huì)導(dǎo)致404!?。?br>我還發(fā)現(xiàn)了另外一個(gè)神奇的BUG:當(dāng)訪問(wèn)http://127.0.0.5/兮http://127.0.0.5/%E5%85%AE )時(shí),服務(wù)器報(bào)404 Object not found,,,
但是當(dāng)訪問(wèn)
http://127.0.0.5/%85%AE
http://127.0.0.5/%85
http://127.0.0.5/%AE
服務(wù)器會(huì)報(bào)403 Access forbidden
這是怎么回事???

回答
編輯回答
愛(ài)礙唉

RewriteRule ^(.*)$ index.php/$1 [QSA,NU,PT,L]

在偽靜態(tài)規(guī)則后面加上 [QSA,NU,PT,L] 配置完成

2017年11月20日 18:28