织梦dedecms最新nginx环境rewrite伪静态规则
规则扣自lnmp一键安装包,应该是非常完整的dedecms nginx伪静态规则。
规则如下:
location / { rewrite "^/index.html$" /index.php last; rewrite "^/list-([0-9]+)\.html$" /plus/list.php?tid=$1 last; rewrite "^/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$" /plus/list.php?tid=$1&totalresult=$2&PageNo=$3 last; rewrite "^/view-([0-9]+)-1\.html$" /plus/view.php?arcID=$1 last; rewrite "^/view-([0-9]+)-([0-9]+)\.html$" /plus/view.php?aid=$1&pageno=$2 last; rewrite "^/tags.html$" /tags.php last; rewrite "^/tag-([0-9]+)-([0-9]+)\.html$" /tags.php?/$1/$2/ last; break; }
使用方法:
打开你的站点配置文件,比如gongju.aizhan.com.conf,在 server { } 里加上上面给的伪静态规则,保存并重启nginx。然后在织梦后台系统设置开启伪静态设置即可。