又是SEO大忌,重复内容!
dedecms的通病所有分类列表的第一页list_1.html与默认分类下的index.html重复的,
怎么搞定别让它生成list_1.html这个页。
找遍了所有方式,总算搞定了。 (别忘记了在下面打赏哦)
第一步:在\include\arc.listview.class.php 找到
1 |
copy($list_1,$indexname); |
下面增加:
1 |
unlink($list_1); |
第二步:
同样,在\include\arc.listview.class.php
大约在105行,找到
1 2 3 4 5 6 7 8 9 10 |
//获得上一页和主页的链接 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"; } else { $indexpage="<li>首页</li>\r\n"; } |
替换成:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$typedir= ereg_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->Fields['typedir']); 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"; } |
第三步,
大约在1185行找到
1 |
$listdd.="<li><a href='".$purl."PageNo=$j'>".$j."</a></li>\r\n"; |
替换成:
1 2 3 4 5 6 7 8 |
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"; } |
搞定了,你去生成试试,(当然,你应先把原来的list_1.html这个页删了;以后再也不会出现list_1.html啦)
如果成功了,别忘记回来打赏!