.htaccess编码已编码的URL

时间:2014-02-25 18:08:15

标签: apache .htaccess http https apache2

我有以下.htaccess条目:

RewriteCond %{SERVER_PORT}   !^443$
RewriteRule  (.*)  https://%{HTTP_HOST}/$1   [L]

当链接到http://...../?f=83|71|42(由浏览器对http://...../?f=83%7C71%7C42进行网址编码)时,会重定向到https://...../?f=83%257C71%257C42,对% %7C进行编码到%25,从而导致序列%257C

是否有任何.htaccess语法来阻止这种情况?

1 个答案:

答案 0 :(得分:2)

尝试添加NE标记:

RewriteCond %{SERVER_PORT}   !^443$
RewriteRule  (.*)  https://%{HTTP_HOST}/$1   [L,NE]
相关问题