详情页

帝国CMS7.5自定义伪静态插件{SEO栏目优化利器}[支持7.0,7.2]

时间:2024年04月24日

编辑:佚名

帝国CMS自定义伪静态插件{SEO栏目优化利器}[支持7.0,7.2]
本文关键字词:自定义伪静态,栏目目录伪静态,内容目录伪静态,帝国cms伪静态,SEO栏目优化
实现栏目目录伪静态,比如news/china/69_1.html 是伪静态实现的,而不是生成静态的。纯绿色不影响帝国原有伪静态、静态和动态等功能设置。
1:栏目要选静态 不生成
2:内容页存放目录–栏目目录,内容页目录存放形式–不设置目录,(有利SEO,方便匹配栏目ID)
3:内容页文件命名形式 不能是目录,但是支持信息文件名的修改,URL也能很好看
4:栏目目录和信息文件名是英文或数字(栏目目录建议英文或英文开头,“-_”上下划线留着给别的东西用吧避免冲突如其它伪静态,避免冲突)
********为了通用只能遵守上述要求,有这些特殊需求自己改去*********
在列表页使用分页号(后缀为.html的)
<?= (int)substr($_GET['page'], 6) && (int)substr($_GET['page'], 6) != 1 ? '第 [!--list.pageno--] 页' : ''?>
在内容页使用分页标题:
<?= (int)str_replace('_', '', $_GET['page']) && (int)str_replace('_', '', $_GET['page']) != 1 ? '[!--p.title--]' : '[!--pagetitle--]'?>
栏目设置截图:


添加伪静态规则
伪静态规则
#栏目
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(d/|e/|html/|images/|s/|search/|skin/|t/)
RewriteRule ^([0-9a-zA-Z/]+)/(|index\.html|index_[0-9]+\.html)$ /e/action/list\.php\?classid=$1&page=$2
#内容
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(d/|e/|html/|images/|s/|search/|skin/|t/)
RewriteRule ^([0-9a-zA-Z/]+)/([0-9a-zA-Z]+)([_0-9]*)\.html$ /e/action/show\.php\?classid=$1&id=$2&page=$3
NGNIX:
location ~* /e/admin/|/sys-static/{
    break;
}
    location ~* {
    rewrite ^/showinfo-([0-9]+)-([0-9]+)-([0-9]+).html$ /e/action/ShowInfo.php?classid=$1&id=$2&page=$3 last;
    rewrite ^/listinfo-([0-9]+)-([0-9]+).html$ /e/action/ListInfo/index.php?classid=$1&page=$2 last;
    rewrite ^/infotype-([0-9]+)-([0-9]+).html$ /e/action/InfoType/index.php?ttid=$1&page=$2 last;
rewrite ^/tags-(.+?)-([0-9]+).html$ /e/tags/index.php?tagname=$1&page=$2 last;
    rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ /e/pl/index.php?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6 last;
    rewrite ^/([0-9a-zA-Z-/]+)/(|index.html|index_[0-9]+.html)$ /e/action/list.php?classid=$1&page=$2 last;
    rewrite ^/([0-9a-zA-Z-/]+)/([0-9a-zA-Z]+)([_0-9]*).html$ /e/action/show.php?classid=$1&id=$2&page=$3 last;
}
【SEO栏目优化利器】帝国CMS自定义伪静态插件[支持7.0,7.2]
链接: https://pan.baidu.com/s/1qrAOXiqXOtF5WcoB6EaDzQ 提取码: v5c6
相关文章
猜你需要