新手教程(八)PbootCMS伪静态配置之Nginx环境

格展网络
116 浏览30 点赞
PB教程网,一个佛系PbootCMS教程博客,了解一下
Nginx环境
1、到后台配置参数中开启伪静态(老版本直接修改程序config/config.php文件url_type=2);
2、在nginx虚拟主机location配置中添加规则,规则如下:

Nginx环境

1、到后台配置参数中开启伪静态(老版本直接修改程序config/config.php文件url_type=2);

2、在nginx虚拟主机location配置中添加规则

1.X版本规则如下:

#1.X版本使用如下规则:
location / {
	if (!-e $request_filename){
		rewrite ^/(.*)$ /index.php/$1 last;
	 }
}

2.X版本规则如下:

location / {
  if (!-e $request_filename){
    rewrite ^/(.*)$ /index.php/$1 last;
  }
}

注意:Nginx中如果站点部署在二级目录,请对应修改重写规则, 如:二级目录为test则:rewrite ^/test/(.*)$ /test/index.php/$1 last;

本文由平台注册作者或者官方发布,未经许可,禁止转载!

本文网址:https://www.yingzia.com

本文来自:@格展网络 | 发布于 2020-06-17 08:59:10

原文来自:https://www.yingzia.com

浏览最多点赞最多文章推荐