首页 > 解决方案 > 所有不存在的文件和文件夹重定向,带有 php 扩展名的文件和文件夹除外

问题描述

我对我的应用程序使用以下指令:

location / {
    root  "C:/Program Files (x86)/EasyPHP-Devserver-17/eds-www";
    index  index.php index.html index.htm;
    autoindex on;
    try_files $uri $uri/ /index.php?param=$uri;
}

它将所有不存在的文件和文件夹重定向到 index.php 与 url 的 $_GET 参数,除了我得到以下错误的 php 文件:

未指定输入文件。

有没有一种解决方法可以使用 .php 扩展名进行这项工作?

标签: phpnginxeasyphpnginx-config

解决方案


推荐阅读