因为pboot网站很容易被黑客入侵,作为小白,最简单的就是把网站部署在宝塔面板上,但是宝塔上面只有Nginx免费防火墙,没有Apache的, 所以我想切换为Nginx。
但是卸载Apache,安装Nginx后,发现网站只有首页能打开, 其他的都打不开,显示404.
研究了一下午,搞好了。
步骤:
1.打开网站设置

2.伪静态设置

3.输入代码
location / {
if (!-e $request_filename){
rewrite ^/index.php(.*)$ /index.php?p=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
}
}
4.保存刷新即可

网友评论