帝国cms 全站伪静态规则设置

发布时间 2023-07-15 11:25:05作者: 夜刺

帝国cms 因为目前来说是免费使用得,而且对于数据承载量以及其他栏目设置方面还是比较友好得,现在大部分网站已经采用帝国cms系统来做了。伪静态相对于静态来说会有更多得好处,今天就说下帝国cms 伪静态规则设置方面得问题

帝国CMS伪静态nginx版:

rewrite ^([^\.]*)/listinfo-(.+?)-(.+?)\.html$ $1/e/action/ListInfo/index.php?classid=$2&page=$3 last;
rewrite ^([^\.]*)/showinfo-(.+?)-(.+?)-(.+?)\.html$ $1/e/action/ShowInfo.php?classid=$2&id=$3&page=$4 last;
rewrite ^([^\.]*)/infotype-(.+?)-(.+?)\.html$ $1/e/action/InfoType/index.php?ttid=$2&page=$3 last;
rewrite ^([^\.]*)/tags-(.+?)-(.+?)\.html$ $1/e/tags/index.php?tagname=$2&page=$3 last;
rewrite ^([^\.]*)/comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)\.html$ $1/e/pl/index\.php\?doaction=$2&classid=$3&id=$4&page=$5&myorder=$6&tempid=$7 last;
rewrite ^/sitemap.xml /sitemap.php;
rewrite ^/sitemap-([0-9]+).xml /sitemap.php?classid=$1;
if (!-e $request_filename) {
return 404;
}

上面是帝国CMS默认的nginx伪静态写法,从帝国CMS7.5起,支持Tagsid功能,也就是以前的tagname改成了tagid,让更喜欢id风格的网友满意了,如果你使用tagid,那么你的伪静态规则需要做以下修改:
rewrite ^([^\.]*)/tags-(.+?)-(.+?)\.html$ $1/e/tags/index.php?tagname=$2&page=$3 last;
改成下面这个样子
rewrite ^([^\.]*)/tags-(.+?)-(.+?)\.html$ $1/e/tags/index.php?tagid=$2&page=$3 last;
最后将修改好的伪静态规则保存到服务器

更多伪静态规则可以查看 玩游网上得设置