404出现的原因
对于pbootcms系统来说,404出现的原因一般有2种
1、当前栏目调用的页面模板不正确,导致链接不存在;
2、伪静态无设置/设置内容错误
解决方法:
1、调用的页面模板不正确
检查后台栏目是否调用错误。或者是检查后台是有有调用的模板文件存在。如没有添加即可。
2、设置网站伪静态
在nginx虚拟主机location配置中添加规则,规则如下:
#1.X版本使用如下规则:
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1 last;
}
}
#2.X+版本使用如下规则:
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?p=$1 last;
}
}
服务器自带的Apache设置方法。这里以宝塔面板后台为例:
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?p=$1 last;
}
}