fastadmin部署出现后台登录404[后台不能伪静态的处理方式]
今天部署fastadmin程序的时候后台登录界面死活是404
http://127.0.0.1/JEKSecoHgV.php
自动跳转到http://127.0.0.1/JEKSecoHgV.php/index/login
然后404
测试
http://127.0.0.1/JEKSecoHgV.php?s=/index/login
成功打开
估计是伪静态的问题
fastadmin默认部署推荐的是thinkphp伪静态
location ~* (runtime|application)/{
return 403;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
中间似乎没有针对后台页面JEKSecoHgV.php的伪静态,但是在一些宝塔下可以正常运行(不知道什么原因)。很不幸,我今天碰到了不能正常运行的宝塔,无奈尝试自己写后台页面的伪静态。
location ~* (runtime|application)/{
return 403;
}
location ^~ /JEKSecoHgV.php/ {
if (!-e $request_filename){
rewrite ^\/JEKSecoHgV\.php(.*)$ /JEKSecoHgV.php?s=$1 last; break;
}
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
最终成功!