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;
	}
}

最终成功!

点赞(3) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部