Discuz教程网

[常见问题] Discuz 7.X细节优化SEO

[复制链接]
authicon 小白 发表于 2013-4-5 10:39:38 | 显示全部楼层 |阅读模式
一、title,keyword和description优化
1. 把根目录、版块列表、帖子列表文件的头文件区分出来,分别建立root_header.htm和forum_header.htm
2. 把header.htm的内容copy到root_header.htm上,root_header.htm上的title、keywords、description分别修改如下:
<title>$seotitle – $bbname</title>
$seohead
<meta name=”keywords” content=”$seokeywords” />
<meta name=”description” content=”$bbname $seodescription” />
修改discuz.htm文件中的{template header}为{template root_header}
设置后台中的标题附加字为 关键字1_关键字2_关键字3,最终首页标题的效果是 关键字1_关键字2_关键字3 – 论坛名
设置后台中的关键字为 关键字1,关键字2,关键字3, 最终首页的关键字效果是 关键字1,关键字2,关键字3
设置后台中的描述为 论坛的描述
3. 把header.htm的内容复制到forum_header.htm上,标题、关键字、描述分别修改如下:
<title>{$metakeywords} – $bbname</title>
$seohead
<meta name=”keywords” content=”{$metakeywords}” />
<meta name=”description” content=”$metadescription $bbname” />
修改forumdisplay.htm文件中的{subtemplate header}为{subtemplate forum_header}
设置对应版块的关键字为 关键字1_关键字2_关键字3,最终版块对应的标题为 关键字1_关键字2_关键字3 版块名 – 论坛名,对应的关键字是 关键字1_关键字2_关键字3
设置对应版块的版块简介为 描述内容 – 论坛名  最终描述显示的是 描述内容 – 论坛名
4. 修改header.htm的关键字、标题、描述标签如下:
<title>$navtitle $bbname</title>
$seohead
<!–{if $thread['tags']}–><meta name=”keywords” content=”{$metakeywords}” /><!–{/if}–>
<meta name=”description” content=”$navtitle $bbname” />
当有tag的时候才显示keywords为tag,没有tag则不显示
修改viewthread.php文件中的$navtitle = $thread['subject'].’ – ‘.strip_tags($forum['name']);
为$navtitle = $thread['subject'];
未修改之前标题形式是:帖子标题 – 版块名称 – 论坛名称
修改后:帖子标题 – 论坛名称
描述为:帖子标题 – 论坛名称
二、静态化与Archiver
(省略)
三、nofollow与robots
Discuz的robots本身就写的很不错了,这里再添加四个:
Disallow: /stats.php
Disallow: /faq.php
Disallow: /invite.php
Disallow: *?*
1. 搜索header文件里的内容,除了logo对应的url以外,其他的全部加nofollow
2. 搜索footer文件,除了本站的链接,其他都加nofollow
3. 搜索discuz.htm文件,除了链接中带有forumdisplay和redirect.php的两个链接外,其他都加上nofollow,把 redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost改
成thread-$forum[lastpost][tid]-1-1.html (注意:这里的后缀要和静态化的后缀一样)
4. 搜索forumdisplay.htm和viewthread.htm文件,除了带有tag、forum和thread的,其他全部加nofollow
5. 做完以上操作之后,会发现首页的最后回帖和版主的用户名所对应的链接还没有加上nofollow,搜索include目录下的forum.func.php文件,查找
$lastpost['author'] = ‘<a href=”space.php?username=’.rawurlencode($lastpost['author']).’”>’.$lastpost['author'].’</a>’;
替换成:$lastpost['author'] = ‘<a href=”space.php?username=’.rawurlencode($lastpost['author']).’” rel=”nofollow”>’.$lastpost['author'].’</a>’;
游客,如果您要查看本帖隐藏内容请回复




上一篇:discuz如何去掉#lastpost动态链接,实现搜索引擎优化
下一篇:Discuz 7.2论坛静态sitemap绿色免安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-5-17 16:05

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表