如果我在“site:www.example.com”下搜索,我看不到任何结果,但如果我搜索“site:example.com”,我会这样做。为什么?

时间:2016-03-03 15:06:02

标签: subdomain google-search google-webmaster-tools

在Search Console中,我将其视为“不设置首选域”。

导致这种情况的原因是什么?

1 个答案:

答案 0 :(得分:-1)

您应该检查HTTP标头。如果www.example.com发现404未找到错误,则Google不会将该子域编入索引。

要确保您同时使用版本以及避免重复内容,请尝试将其添加到.htaccess:

RewriteEngine on
# Redirect non-www to wwww
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.org [NC]
RewriteRule ^(.*)$ http://www.yourdomain.org/$1 [R=301,L]