#2179

alekslak
Участник

$vsego_page=ceil($this->kolvo_vsego_all_advert/$masConfig[“KOL_ADVERT_TO_ALL_PAGE”]);//всего страниц пагинации
$first_page=$this->open_num_page_all_advert+1;
$next_page=$this->open_num_page_all_advert+1;
$prev_page=$this->open_num_page_all_advert-1;
$num_user=$this->mas_inbox[“num_user”];

if($this->open_num_page_all_advert==1){
$header_link=”\n”.”<link rel=’next’ href='”.$this->dir_http.”/advuser”.$num_user.”/advuspage”.$first_page.”.html’ />”;
$header_link.=”\n”.”<link rel=’canonical’ href='”.$this->dir_http.”/advuser”.$num_user.”/’ />”;
}else
if($this->open_num_page_all_advert<$vsego_page){
$header_link=”\n”.”<link rel=’next’ href='”.$this->dir_http.”/advuser”.$num_user.”/advuspage”.$next_page.”.html’ />”;
$header_link.=”\n”.”<link rel=’prev’ href='”.$this->dir_http.”/advuser”.$num_user.”/advuspage”.$prev_page.”.html’ />”;
$header_link.=”\n”.”<link rel=’canonical’ href='”.$this->dir_http.”/advuser”.$num_user.”/advuspage”.$this->open_num_page_all_advert.”.html’ />”;
}else
if($this->open_num_page_all_advert==$vsego_page){
$header_link=”\n”.”<link rel=’prev’ href='”.$this->dir_http.”/advuser”.$num_user.”/advuspage”.$prev_page.”.html’/>”;
$header_link.=”\n”.”<link rel=’canonical’ href='”.$this->dir_http.”/advuser”.$num_user.”/advuspage”.$this->open_num_page_all_advert.”.html’ />”;
}

Сделал вот так, проблема с тегами ушла!

Но точно не правильно настроен редирект, при ручном вводе или при переходе на /advuser2/advuspage1.html получаем 404-ую