很有用的dedecms5.6版全站伪静态,对SEO很有帮助

dedecms我一直在用,在SEO方面它一直做的不错,因为他可以全站静态不过你如果网站内容很多的话,生成一次需要很长时间,DEDECMS一直都有伪静态功能,现在我就说说如何使用这个功能。

伪静态前的一些基础设置

1、服务器支持
2、后台开启伪静态:dedecms后台-系统-系统基本参数-核心设置-是否使用伪静态,选“是”。
3、设置栏目使用动态浏览:可以手动一个一个的设置,也可以使用下边的SQL命令,这样比较快,你可以收藏这个页面,以后方便查找。
dedecms后台-SQL命令行工具,执行以下语句

将所有栏目设置为“使用动态页”:update dede_arctype set isdefault=-1

4、设置文章使用动态浏览,使用下边的SQL命令,后边的-1是动态,1是静态,
将所有文档设置为“仅动态浏览”:update dede_archives set ismake=-1

5、
改php文件include/channelunit.func.php

查找

return $GLOBALS["cfg_plus_dir"].”/view-”.$aid.’-1.html’;

修改为

return “/view-”.$aid.’-1.html’;

查找

return $GLOBALS['cfg_phpurl'].”/view.php?aid=$aid”;

修改为

return “/view.php?aid=$aid”;

其实页可以不修改,就是URL地址会长一点。这个是文章页的。

查找

$reurl = $GLOBALS['cfg_phpurl'].”/list.php?tid=”.$typeid;

修改为

$reurl = “/list-”.$typeid.”.html”;

这个必须修改,是栏目页的。

其实不修改也可以,但是URL地址会长一点。这个是文章的。

6、打开include/arc.listview.class.php

找到

$plist = str_replace(‘.php?tid=’, ‘-’, $plist);

(大约在第964行)

在其前面面添加一行

$plist = str_replace(‘plus/list’, ‘list’, $plist);

7、设置规则
win主机的规则设置

[ISAPI_Rewrite]

# 缓存3600秒 = 1 小时(hour)
CacheClockRate 3600

RepeatLimit 32

#dedecms Rewrite规则
RewriteRule ^(.*)/index\.html $1/index\.php
RewriteRule ^(.*)/list-([0-9]+)\.html $1/plus/list\.php\?tid=$2
RewriteRule ^(.*)/list-([0-9]+)-([0-9]+)-([0-9]+)\.html $1/plus/list\.php\?tid=$2&TotalResult=$3&PageNo=$4
RewriteRule ^(.*)/view-([0-9]+)-([0-9]+)\.html $1/plus/view\.php\?arcID=$2&pageno=$3

linux平台.htaccess规则

RewriteEngine On

RewriteRule ^list/down-([0-9]+)-1\.html$ /plus/list.php?tid=$1
RewriteRule ^list/down-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3
RewriteRule ^game/([0-9]+)\.html /plus/view\.php\?arcID=$1
RewriteRule ^game/([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$1&pageno=$2
RewriteRule ^xiaoyouxi/$ /plus/list.php?tid=9
RewriteRule ^(.*)/index\.html $1/index\.php

此条目发表在 搜索引擎优化 分类目录,贴了 , , , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>