欧美日韩国产精选国产永久在线入口|久久精品无码av色色丁香婷婷五月|欧美伊人网91天天视频色板一区|啪啪激情五月天国产高清一卡二卡|激情五月天丁香高清有码无码中文|高清无码免费在线看免费黄片|蜜桃亚洲 无码二区三区黄色网|人人叉人人爽日美黄色视频

新聞中心

ZenCart清理重復(fù)網(wǎng)址與頁面的方法

作者 / 無憂主機 時間 2015-11-09 21:23:32

網(wǎng)站內(nèi)容重復(fù),是百度K站的一個主要原因,但是也有一些人并不知道什么情況才算網(wǎng)站內(nèi)容重復(fù),也不知道如何解決網(wǎng)站內(nèi)容重復(fù)的問題。網(wǎng)站內(nèi)容重復(fù)不單單是指網(wǎng)站本身出現(xiàn)了兩篇或者多篇一樣的文章,還包括很多方面如同樣一篇文章出現(xiàn)多個URL,即使這篇文章屬于原創(chuàng),也會被百度給予懲罰。在或者網(wǎng)站內(nèi)容多為采集,這種網(wǎng)站內(nèi)容重復(fù)會被當(dāng)做采集站直接被百度處理掉,百度新的綠蘿算法就是專門打擊采集站點的。所以說一旦重復(fù)內(nèi)容的鏈接被搜索引擎收錄那么你的網(wǎng)站將會受到懲罰。今天無憂主機看到一文ZenCart清理重復(fù)網(wǎng)址與頁面的方法迫不及待想分享給大家。 舉例說明: ZenCart網(wǎng)站安裝了Ultimate SEO URLs,進行了URL偽靜態(tài)后 比如本來商品分類名稱為:php空間 網(wǎng)址為:www.love62.cn 那php空間的URL為:http://www.love62.cn/hk-c-1.html 現(xiàn)在我在后臺把商品分類php空間改為香港獨立IP空間 那香港獨立IP空間的URL為http://www.love62.cn/hk_ip-c-1.html 這2個URL指向的其實是同一個頁面,有沒有讓原來的URL傳遞到新的URL的方法呢?方法是有的繼續(xù)往下看: 1、登錄ZenCart后臺->商店設(shè)置->搜索引擎優(yōu)化->打開自動跳轉(zhuǎn)嗎?設(shè)置為true。 2、文本編輯器打開文件:\includes\classes\seo.url.php 查找:

$this->attributes['SEO_REDIRECT']['NEED_REDIRECT'] = $this->need_redirect ? 'true' : 'false';
在以上代碼前添加下列代碼:
// check product name from URL and redirect if not equal to real product name to avoid duplicates
if ( preg_match('/-p-[0-9]/i', $this->uri) && preg_match('/main_page=product_info/i', $this->real_uri) ) {
$productname_from_url = preg_replace('/-p-[0-9].*/i','',$this->uri);
$productid_from_url= preg_replace('/.*-p-([0-9]+)\.html/i','$1',$this->uri);
if ( $this->get_product_name($productid_from_url) != $productname_from_url ) {
$this->need_redirect = true;
// repeating procedure from function check_redirect() but for real_uri
if ($this->is_attribute_string($this->real_uri)) {
$parsed_url = parse_url($this->real_uri);
$this->uri_parsed = parse_url($parsed_url['scheme']);
$this->uri_parsed['query'] = preg_replace('/products_id=([0-9]+)/', 'products_id=$1:' . $parsed_url['path'], $this->uri_parsed['query']);
} else {
$this->uri_parsed = parse_url($this->real_uri);
}
}
} // end of product_info URL redirect

// check category name from URL and redirect if not equal to real category name to avoid duplicates
if ( preg_match('/-c-[0-9]/i', $this->uri) && preg_match('/main_page=index/i', $this->real_uri) ) {
$categoryname_from_url = preg_replace('/-c-[0-9].*/i','',$this->uri);
$categoryid_from_url= preg_replace('/.*-c-([0-9]+)\.html/i','$1',$this->uri);
if ( $this->get_category_name($categoryid_from_url) != $categoryname_from_url ) {
$this->need_redirect = true;
// repeating procedure from function check_redirect() but for real_uri
if ($this->is_attribute_string($this->real_uri)) {
$parsed_url = parse_url($this->real_uri);
$this->uri_parsed = parse_url($parsed_url['scheme']);
$this->uri_parsed['query'] = preg_replace('/cPath=([0-9]+)/', 'cPath=$1:' . $parsed_url['path'], $this->uri_parsed['query']);
} else {
$this->uri_parsed = parse_url($this->real_uri);
}
}
} // end of category URL redirect
無憂主機相關(guān)文章推薦閱讀: 如何將ZEN CART的搜索更加準(zhǔn)確 ZEN CART根據(jù)用戶搜索的關(guān)鍵詞來定義為TITLE ZEN CART如何將后臺訂單顯示圖片以及產(chǎn)品鏈接

本文地址:http://www.love62.cn/zencart/20677.html

1
1
1
1
1
1
1

客戶服務(wù)熱線

0791-8623-3537

在線客服