
帝国CMS还是非常不错的网站构建程序,特别是随着国内建站程序的逐渐没落,还能够保持强劲的更新能力和用户,足以说明帝国CMS的优秀。相信大家对帝国CMS的TAGS标签页还是不陌生的,帝国CMS的tags页面URL默认是
1
| /e/tags/index.php?tagname=xxxxxxxx
|
这种形式的,我们希望的是后缀变成
1
| http://www.laoliublog.com/tags-etagid17-0.html
|
其中后面的0
是页数,前面的id
就是tags
的id
这种形式的,那么如何来设置呢?如图所示:

说明:采用静态页面时不需要设置,只有当采用动态页面时可通过设置伪静态来提高SEO优化,如果不启用请留空。注意:伪静态会增加服务器负担,修改伪静态格式后你需要修改服务器的 Rewrite 规则设置。
.htaccess文件内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <ifmodule mod_rewrite.c> RewriteEngine On ErrorDocument 404 /404.html Rewritebase / #信息列表 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^listinfo-(.+?)-(.+?)\.html$ /e/action/ListInfo/index\.php\?classid=$1&page=$2 #信息内容页 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^showinfo-(.+?)-(.+?)-(.+?)\.html$ /e/action/ShowInfo\.php\?classid=$1&id=$2&page=$3 #标题分类列表页 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^infotype-(.+?)-(.+?)\.html$ /e/action/InfoType/index\.php\?ttid=$1&page=$2 #TAGS信息列表页 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^tags-(.+?)-(.+?)\.html$ /e/tags/index\.php\?tagname=$1&page=$2 #评论列表页 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)\.html$ /e/pl/index\.php\?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6 </ifmodule>
|
这里我测试机上用的是Apache
的服务环境,如果别的环境请自行转换。
NGINX的规则如下:
1
| rewrite ^/tags-(.+?)-([0-9]+).html$ /e/tags/index.php?tagname=$1&page=$2 last;
|
希望能够帮助到家!当然了,帝国CMS其他的问题,你可以自己在老博客里面找一下,或许会帮助到您!