要取消nginx中的index.php路由配置,您可以按照以下步骤进行操作:
/etc/nginx/nginx.conf
或/etc/nginx/conf.d/default.conf
。server
块中找到location /
配置项,它通常类似于以下内容:location / {
try_files $uri $uri/ /index.php?$query_string;
}
/index.php?$query_string
部分删除,使其变为:location / {
try_files $uri $uri/ /;
}
sudo service nginx reload
现在,nginx将不再自动将请求重写到index.php文件,而是直接访问请求的URL路径。
上一篇:php 是否在二维数组
下一篇:php 字符串转换为数组
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站