SEO角度dedecms栏目页优化,翻页URL链接地址统一

2019-08-1506:39:09网站建设与开发SEO角度dedecms栏目页优化,翻页URL链接地址统一已关闭评论1,964 views字数 1127阅读模式

dedecms建站的时候,细心的人会发现它的列表首页页面会出现两个不同的链接文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

一个是在其他页面链接到栏目首页的url,是www.lwseo.cn/seo/index.html文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

另一个是栏目的分页给的链接URL是:www.lwseo.cn/seo/list_1_1.html文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

老威认为,从SEO的角度来看这两个链接,一个网页有2个网址是不太好的。所以,我们最好把两个URL统一成index.html,具体方法如下文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

1,找到\include\arc.listview.class.php这个文件,将文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

PHP
$typedir= ereg_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->Fields['typedir']);

这段代码添加到”//获得上一页和主页的链接”前面;文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

2,找到下面几行代码(就在”//获得上一页和主页的链接”下面)文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

PHP
if($this->PageNo != 1)
{
$prepage.="<li><a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a></li>\r\n";
$indexpage=<li><a href='".str_replace("{page}",1,$tnamerule)."'>首页</a></li>\r\n";
}

改成:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

PHP
if($this->PageNo != 1)
{
if($prepagenum==1)
{
$prepage.="<li><a href=\"".$typedir."/\">上一页</a></li>\r\n";
}
else
{
$prepage.="<li><a href=\"".str_replace("{page}",$prepagenum,$tnamerule)."\">上一页</a></li>\r\n";
}
$indexpage="<li><a href=\"".$typedir."/\">首页</a></li>\r\n";
}

3.找到文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

PHP
$listdd.="<a href='".str_replace("{page}",$j,$tnamerule)."'>".$j."</a>\r\n";

改成:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

PHP
if($j==1)
{
$listdd.="<li><a href=\"".$typedir."/\">".$j."</a></li>\r\n";
}
else
{
$listdd.="<li><a href=\"".str_replace("{page}",$j,$tnamerule)."\">".$j."</a></li>\r\n";
}

只需要三步就可以实现织梦栏目页翻页URL链接地址统一优化了。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/15270.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/cms/15270.html