简体   繁体   English

规范标签问题,在我的主页上,我应该“href”到什么?

[英]Canonical Tag question, on my main page, what should I "href" to?

I have read a lot online by now and can't seem to get the hang of it... what should be my canonical tag for my site, the https://example.com or the https://example.com/index.html ?我现在已经在网上阅读了很多内容,但似乎无法掌握它......我的网站的规范标签应该是什么, https://example.comhttps://example.com/index.html ?

No matter what I do, Google Search Console says that I did not declare anything as canonical... I have already uploaded a sitemap.xml file, added the <link rel="canonical" href="http://exapmle.com/"> , and validated the domain in the server with DNS.无论我做什么,Google Search Console 都说我没有将任何内容声明为规范......我已经上传了一个sitemap.xml文件,添加了<link rel="canonical" href="http://exapmle.com/"> ,并使用 DNS 验证服务器中的域。

Answering your question on which one should be canonical tag for your site: https://example.com or the https://example.com/index.html - it depends on which one of these pages you consider the original one.回答关于哪个应该是您网站的规范标签的问题: https://example.com : https://example.comhttps://example.com/index.html - 这取决于您认为这些页面中的哪一个是原始页面。

If https://example.com is your original and you want to tell that to Google Search Engine, then add to this page header <link rel="canonical" href="https://example.com" /> because you still need to have canonical tag for each page, I will explain below why.如果https://example.com是您的原创,并且您想将其告诉 Google 搜索引擎,请添加到此页眉<link rel="canonical" href="https://example.com" />因为您每个页面仍然需要有规范标签,我将在下面解释原因。 Then https://example.com/index.html is your duplicate content page.然后https://example.com/index.html是您的重复内容页面。 Go to this page header and add <link rel="canonical" href="https://example.com" /> - this will tell Google that https://example.com is your original one.转到此页眉并添加<link rel="canonical" href="https://example.com" /> - 这将告诉 Google https://example.com是您的原始页面。

First off all you need to understand what is Canonical URL.首先,您需要了解什么是规范 URL。 In Google's own words:用谷歌自己的话来说:

A canonical URL is the URL of the page that Google thinks is most representative from a set of duplicate pages on your site.规范 URL 是 Google 认为在您网站上的一组重复页面中最具代表性的页面的 URL。

All pages should have a canonical tag to prevent any possible duplication.所有页面都应该有一个规范标签,以防止任何可能的重复。 Even if do know that you don't have any other versions of a page that are duplicate in terms of it's content, still, just include a canonical tag that links to itself.即使知道您没有任何其他版本的页面在其内容方面是重复的,仍然只需包含一个链接到自身的规范标签。

It's very easy to have duplicate content without even noticing it.很容易在没有注意到的情况下拥有重复的内容。 Great example of this, imagine that all inks below display exactly the same content on each page:一个很好的例子,想象下面的所有墨水在每个页面上显示完全相同的内容:

https://www.example.com/category/product-a/

https://www.example.com/product-a/

https://m.example.com/product-a/

https://www.example.com/product-A/

Search engines like Google sees this as 4 duplicate pages. Google 等搜索引擎将此视为 4 个重复页面。

So the best way to you to forget about duplicate content (canonical URL errors) is to use this schema:因此,忘记重复内容(规范 URL 错误)的最佳方法是使用此架构:

  1. All of your pages should have maximum of 1 canonical URL in page header.您的所有页面都应在页眉中包含最多 1 个规范 URL。 Example:例子:

    <link rel="canonical" href="https://example.com/" /> Even though you don't have duplicated content - just point original page URL to itself as canonical. <link rel="canonical" href="https://example.com/" />即使您没有重复的内容 - 只需将原始页面 URL 指向其自身作为规范。

  2. Now, if you have multiple duplicated pages, and let's say your original are https://example.com/ but you also have:现在,如果您有多个重复的页面,假设您的原始页面是https://example.com/但您还有:

    https://example.com (without / at the end. Yes, this is duplicated content!) https://example.com (没有 / 结尾。是的,这是重复的内容!)

    https://example.com/1/

    Then you go to that pages and do this:然后你去那些页面并执行以下操作:

    • in https://example.com page's header add:https://example.com页面的标题中添加:

      <link rel="canonical" href="https://example.com/" />

    • in https://example.com/1/ page's header add:https://example.com/1/页面的标题中添加:

      <link rel="canonical" href="https://example.com/" />

Easy as that.就这么简单。 Let me know if this answers your question and if you have more questions - I'm happy to help!让我知道这是否能回答您的问题,如果您有更多问题 - 我很乐意为您提供帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM