主要是因为path info的问题 , 我试了很多方式 , 就这个亲测有效 ,
前提是你试试 你的网址.com/index.php?s=index/index/index , 这个路径是否能正常访问你的首页 . 如果可以 , 修改你nginx.conf 在server中 , 添加下面这段 .
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
保存重启nginx ( 亲测有效 )
本文介绍了一种解决PathInfo问题的有效方法,通过修改Nginx配置文件,确保网站路径如.com/index.php?s=index/index/index能够正确访问首页。关键是在server段落中添加特定的location规则,实现rewrite重写,适用于遇到类似问题的开发者。

2228

被折叠的 条评论
为什么被折叠?



