views:

24

answers:

1

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?

A: 

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.

Andrew Medico