2014-03-18 25 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