首先需要说明下的是,帝国官方CMS7.5新增了Tags的Tagname转Tagid功能,这意味着以后的伪静态我们可以使用tag-id格式来命名网址了,在一定意义上是有助于SEO的。
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伪静态写法,我们需要做的是将其中的Tag项改改
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;
这样提交到服务器或主机就可以了,值得注意的是,我们还需要到后台去,将TAG信息列表页规则改一下
如图所示,改成tags-[!--tagid--]-[!--page--].html就万事OK了
好了,关于其它类型主机的伪静态规则,大家可以自己去转换,网上有很多在线转换工具的!
如果实在找不到,可以用我给大家找的,功能还是可以的。
http://www.bt.cn/Tools