dedecms The URL link address on the first page of the program's column list has two addresses with the same content but different URLs. It is not good for website SEO to have two URLs on one page. Therefore, we'd better unify the two URLs into one address.

Default effect:

The default URL link of the first page of the column: //hongdouh.cn/jiaocheng/index.html

URL link of the first page of column pagination: //hongdouh.cn/jiaocheng/list_14_1.html

The modification method is as follows:

1. Open the file include rc.listview.class.php, and

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

This code is added before "//Get the link to the previous page and home page";

2. Find the following lines of code (just under "//Get links to the previous page and home page")

if($this->PageNo != 1)
{
$prepage.= "<li><a href='".str_replace("{page}",$prepagenum,$tnamerule). "'>Previous page</a></li>";
$indexage="<li><a href='". str_replace ("{page}", 1, $tnamerule). "'>Home</a></li>";
}

Change to:

if($this->PageNo != 1)
{
if($prepagenum==1)
{
$prepage.= "<li><a href=" ". $typedir."/">Previous</a></li>";
}
else
{
$prepage.= "<li><a href=" ". str_replace (" {page} ", $prepagenum, $tnamerule)." ">Previous</a></li>";
}
$indexage="<li><a href=" ". $typedir."/">Home</a></li>";
}

3. Find

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

Change to

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

Complete the above three steps to optimize and unify the URL link address of the first page of Dream Weaving column.

For the effect, please see the column address of this site, which is available for personal testing.

Post reply

Can't comment until