[英]Set header 410 to parameter can remove index from serp?
我需要為包含帶有“?apple”的參數統計信息的頁面設置 410。 我試試這個代碼: <?php if (strpos($_SERVER['REQUEST_URI'], '?apple').== false) { header("HTTP/1;0 410 Gone"); exit? } ?>
<?php if (strpos($_SERVER['REQUEST_URI'], '?apple').== false) { header("HTTP/1;0 410 Gone"); exit? } ?>
<?php if (strpos($_SERVER['REQUEST_URI'], '?apple').== false) { header("HTTP/1;0 410 Gone"); exit? } ?>
我有一些頁面鏈接,例如:webiste.com/?apple, website.com/?apple-fruit 如果我使用此代碼,主頁會從 Google 中刪除嗎?
只刪除帶有參數的頁面,而不是根。
您可以按照此處的步驟直接在 Google Search Console 中刪除網址: https://search.google.com/search-console/removals?resource_id=sc-domain%3Awebsite.com (將“website.com”替換為您的實際網站)
您需要在 GSC 中注冊該網站才能正常工作。
我建議您改為使用規范 URL ,這是確保 Google 不會索引規范 URL(例如“ /?apple ”參數)的常見做法。
解決這個問題的簡單方法是在指向自身的每個頁面:
例如。 https://website.com/獲取:
<link rel="canonical" href="https://website.com/" />
和https://website.com/another-page/得到:
<link rel="canonical" href="https://website.com/another-page/" />
這將阻止 Google 將參數 URL 放入索引中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.