Apache does not generate a 404

后端 未结 2 1688
再見小時候
再見小時候 2021-01-26 09:19

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 conte

2条回答
  •  情歌与酒
    2021-01-26 10:09

    /nonexistant.gif will be HTTP "PATH_INFO": http://www.ietf.org/rfc/rfc3875, section 4.1.5

    Basically, the webserver will scan "down" a url until it hits an actual file. Anything after that file in the url becomes 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
    

提交回复
热议问题