dz不登录访问keywords
<meta name="keywords" content="关键词" />
<meta name="description" content="描述信息" />
退出登录以游客身份再从浏览器查看源文件,就会变成这样:
<meta name="keywords" content="首页" />
<meta name="description" content="首页 " />
<meta name="generator" content="Discuz! X2.5" />
我的首页(门户)搜索结果description部分显示不正确,不知道是不是就是这个原因。搜索链接如下:
http://www.baidu.com/s?wd=www.xxxx.com
首页(门户)已经被百度收录了,但是以首页的唯一keyword“某某关键词”进行搜索,不能搜索到。
搜索链接:
http://www.baidu.com/s?wd=关键词
是不是因为keywords不能正确显示的原因?
网页allthebest回复:
试试
source/class/helper/helper_seo.php
38行改为:
if($descriptiontext && (CURSCRIPT == 'forum' || CURSCRIPT == 'portal' || IS_ROBOT || $_G['adminid'] == 1)) {
$seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
}
if($keywordstext && (CURSCRIPT == 'forum' || CURSCRIPT == 'portal' || IS_ROBOT || $_G['adminid'] == 1)) {
$seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
}
///
问题已解决,删除source/class/helper/helper_seo.php文件中的:&& (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)
if($$descriptiontext) {
$$seodescription = helper_seo::strreplace_strip_split($$searchs, $$replaces, $$descriptiontext);
}
if($$keywordstext) {
$$seokeywords = helper_seo::strreplace_strip_split($$searchs, $$replaces, $$keywordstext);
}
今天也试了下,达到预想效果。转发供大家学习