在织梦DedeCMS的程序中,其实也有一些重复的页面,想要优化URL,这样的情况是不可能存在的,就比如你列表页的第一页,/xinwenzhongxin/index.html,但是生成之后也会出现/xinwenzhongxin/list_1_1.html,所以这样就会对优化存在很大的问题。修改的方法:
1 | 找到\include\arc.listview.class.php这个文件,将
$typedir= ereg_replace(‘{cmspath}’,$GLOBALS[‘cfg_cmspath’],$this->Fields[‘typedir’]);;
这段代码添加到”//获得上一页和主页的链接”前面;
2 | 找到下面几行代码(就在”//获得上一页和主页的链接”下面)
if($this->PageNo != 1)
{
$prepage.=”
上一页\r\n”;
$indexpage=”首页\r\n”;
}
改成:
if($this->PageNo != 1)
{
if($prepagenum==1)
{
$prepage.=”上一页\r\n”;
}
else
{
$prepage.=”上一页\r\n”;
}
$indexpage=”首页\r\n”;
}
3 | 找到
$listdd.=”“.$j.”\r\n”;
改成:
if($j==1)
{
$listdd.=”“.$j.”\r\n”;
}
else
{
$listdd.=”“.$j.”\r\n”;
}