下面是根据我的经历,所编写:
我是使用宝塔搭建的,环境如下:
Nginx 1.22.1
MySQL 5.7.40
PHP-7.4.33
phpMyAdmin 5.2
搭建时我按照源码提供的伪静态
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php[L,E=PATH_INFO:?$1];
}
}
除了首页其它页面都出现下面情况:
我找了很久,最终发现是伪静态的原因。伪静态如下:
location ~* (runtime|application)/{
return 403;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
刷新页面后就恢复正常了
评论