2014-03-18 75 views
0

如果我在服务器上有/faq.php那么它也可以通过/faq.php/nonexistant.gif访问它为什么?我已确保MultiViews被禁用。为什么当我访问URI /faq.php/randomstuff.gif时,显示/faq.php的内容?仅供参考,我在同一个目录中没有htaccess文件。Apache不会生成404

回答

2

/nonexistant.gif将HTTP “PATH_INFO”:http://www.ietf.org/rfc/rfc3875,第4.1.5

基本上,Web服务器将扫描 “向下” 的URL,直到遇到一个实际的文件。该文件中的任何内容都将成为PATH_INFO。

http://example.com/some/path/leading/to/realfile.php/extra/stuff/that/becomes/path/info 
        ^^^^^^^^^^^^^^^^^^^^--- real directories 
             ^^^^^^^^^^^^--actual file, scanning stops here 
                ^^-----onwards = path_info