google 将从网站管理员工具中索引哪个版本?

Which version will google index from webmaster tools?

我刚刚推出了一个网站。我正在使用 https 协议。所以我的域名是 https:// example

我创建了一个 google 网站管理员工具帐户并验证我是 https:// 示例和 https:// 示例的所有者

然后我尝试在站点设置中设置我的首选域(https:// 示例),它要求验证我是 http://example and http://www 的所有者。例子

所以我现在在网站管理员工具中设置了 4 个不同版本的网站。我将我的首选域设置为 example.com ,它不允许我选择首选协议。

我的问题是,google 如何知道索引 https:// 而不是 http:// ?

您可以告诉 google: https://support.google.com/webmasters/answer/139066?hl=en

Indicate the preferred URL with the rel="canonical" link element

Suppose you want https://blog.example.com/dresses/green-dresses-are-awesome/ to be the preferred URL, even though a variety of URLs can access this content. You can indicate this to search engines as follows:

Mark up the canonical page and any other variants with a rel="canonical" link element.
Add a <link> element with the attribute rel="canonical" to the <head> section of these pages: 

<link rel="canonical" href="https://blog.example.com/dresses/green-dresses-are-awesome" />

重定向

假设您希望在 https://example.com, you can redirect all requests to http://example.com, http://www.example.com, and https://www.example.com to be sent to https://example.com.

下索引所有内容

这是最好的方法,因为它使所有内容保持干净,并且只能通过一个域和协议直接访问。 Google(以及所有其他用户)如果尝试访问任何其他变体,将遵循重定向。

rel 规范

另一种选择是使用 rel=canonical 并将其设置为首选域。这允许您仍然通过两种协议、根域和 www 提供相同的内容。子域,但将首选域设置为应作为访问该内容的位置编制索引的域。

无索引

第三个选项是对从非首选域/协议提供的所有内容指定 noindex。这将确保搜索引擎只会索引在首选域(未设置 noindex 集)上提供的内容。

但我不会推荐这个,因为它对 SEO 不利 - 如果有人 link 到 http://example.com 而你没有索引,那么 link 将被 SE 忽略。而如果您使用重定向或 rel 规范,link 将计入规范/重定向转到的首选域上的页面。


明确一点,无论何时使用重定向或 rel 规范,您都必须将其指向首选域上的相应页面。 所以http://example.com/some-page/ should redirect to https://example.com/some-page/, not just https://example.com/

您无法使用 Google 网站站长工具进行任何设置,您需要在托管您网站的服务器上进行设置。执行此操作的方法取决于您的服务器的配置方式。