Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url nginx-如果index.php/filename,则找不到文件_Url_Nginx_Routing - Fatal编程技术网

Url nginx-如果index.php/filename,则找不到文件

Url nginx-如果index.php/filename,则找不到文件,url,nginx,routing,Url,Nginx,Routing,如果我在index.php之后放置另一个URL参数,Nginx将出现“未找到文件”错误: http://localhost/index.php/testfile.html 如何使nginx不出现此错误并将“/testfile.html”作为参数处理 谢谢 在您给定的url中,它希望有一个名为index.php的文件夹,但似乎您希望在某种程度上将testfile.html传递到index.php文件,您可以通过GET或POST来完成 基本上,如果您执行类似http://localhost/i

如果我在index.php之后放置另一个URL参数,Nginx将出现“未找到文件”错误:

http://localhost/index.php/testfile.html
如何使nginx不出现此错误并将“/testfile.html”作为参数处理


谢谢

在您给定的url中,它希望有一个名为
index.php
文件夹,但似乎您希望在某种程度上将testfile.html传递到index.php文件,您可以通过
GET
POST
来完成

基本上,如果您执行类似
http://localhost/index.php?file=testfile.html
,您可以访问thorugh$\u GET变量并将其包括在内(使用PHP)


这是假设您需要动态地执行此操作,如果您只想始终包含该文件,那么您可以使用PHP的包含功能。

是的,我正在尝试实现类似于前端控制器的功能,因此index.PHP是我的控制器,而“testfile.html”是一个参数。我不能用斜杠“/”吗?