简体   繁体   English

使用命名冲突提供文件

[英]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. script.php显然是一个PHP文件,它将被解释并返回其输出。 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. file1似乎是script.php目录中的某种文件,但是没有操作系统允许文件和目录共享相同的名称。

What's going on here? 这里发生了什么? Do I need to configure my server and/or PHP to do something this funky? 我是否需要配置服务器和/或PHP才能执行此时髦的操作?

In the second example, "file1" is being passed as a parameter to the "script.php" CGI program. 在第二个示例中,“ file1”作为参数传递给“ script.php” CGI程序。 This is a little-known but fully supported CGI syntax. 这是鲜为人知但完全受支持的CGI语法。 See Section 3.2 of http://www.rfc-editor.org/rfc/rfc3875.txt . 请参阅http://www.rfc-editor.org/rfc/rfc3875.txt的 3.2节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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