怎么做 。 匹配所有在Apacheconfiguration?

在httpd.conf里面:

rewriterule ^questions/([0-9]+).* ... 

它匹配/questions/1674/<textarea> ,但不是/questions/1674/<textarea><%2Ftextarea>

如果在URI中有一个正斜杠,Apache将返回一个immediete 404。错误日志将会显示:

[info] [client 1.2.3.4]在URI(coded ='/ question / 1 /')中find%2f(编码的'/'),返回404

要解决这个问题,可以在httpd.conf的根目录或<VirtualHost>部分添加下面的指令:

AllowEncodedSlashes On

然后你的重写将起作用。 来自Apache手册的信息:

AllowEncodedSlashes指令允许使用包含编码path分隔符(%2F for /和另外%5C for \ on根据系统)的URL。 通常这样的URL被404(未find)错误拒绝。

有关更多信息,请参阅:

http://httpd.apache.org/docs/2.0/mod/core.html#allowencodedslashes

http://blog.dynom.nl/archives/Apaches-fail-with-encoded-slashes_20090625_40.html

也许你需要规则上的无逃脱[NE]标志? 在这个页面中searchnoescape。