Apache不会产生404 [英] Apache does not generate a 404
问题描述
如果服务器上有/faq.php
,也可以通过/faq.php/nonexistant.gif
访问它,为什么?我确保已禁用MultiViews.为什么在访问URI /faq.php/randomstuff.gif
时显示/faq.php
的内容?仅供参考,我在同一目录中没有htaccess文件.
if I have /faq.php
on the server it can also be accessed via /faq.php/nonexistant.gif
why? I have made sure MultiViews are disabled. Why does the contents of /faq.php
get shown when I access the URI /faq.php/randomstuff.gif
? FYI, I have no htaccess file in the same directory.
推荐答案
即称为path_info
.您可以使用apache配置中的AcceptPathInfo Off
禁用它.人们通常会在无法使用mod重写时将其用作伪造的mod重写.
That is called path_info
. You can disable it using AcceptPathInfo Off
in the apache config. People generally use it as a fake mod rewrite when mod rewrite is not availalble.
http://httpd.apache.org/docs/2.2/mod/core.html#acceptpathinfo
这篇关于Apache不会产生404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!