简体   繁体   中英

Serving files with naming conflicts

I'm trying to duplicate something that's being done on a website that seems a bit weird. They are serving both

h**p://site.com/script.php      

      AND

h**p://site.com/script.php/file1

This doesn't seem to make any sense to me. script.php is clearly a PHP file that will get interpreted and have its output returned. file1 seems like its some sort of file in the script.php directory, but no operating system is going to allow a file and a directory to share the same name.

What's going on here? Do I need to configure my server and/or PHP to do something this funky?

In the second example, "file1" is being passed as a parameter to the "script.php" CGI program. This is a little-known but fully supported CGI syntax. See Section 3.2 of http://www.rfc-editor.org/rfc/rfc3875.txt .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM