Apache不会产生404 [英] Apache does not generate a 404

查看:117
本文介绍了Apache不会产生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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆