2011-02-14 28 views
2

Google正在Google上扫描我的网站,包括我不希望它扫描的查询字符串。 例如:它们是一个页面 - “/name.html”,在URL中有一个查询字符串 - “/name.html?qs=1”。我不希望Google在其索引中包含“?qs = 1”,因为此查询字符串不是必需的,在Google上搜索我的网站时,它会创建大量重复项和垃圾。Google正在扫描我不想要的查询字符串

如何禁用Google为此查询字符串编制索引并删除已经编入索引的页面的功能?

回答

3

您应该使用robots.txt来做到这一点。

下面是一个例子:

user-agent: * 
disallow: /name.html? 

这将阻止任何呼叫与查询字符串name.html,但将索引你的name.html。

也有这个版本:

user-agent: * 
disallow: /name.html?qs= 

这将阻止任何呼叫包含在你的查询字符串参数“QS”到name.html,但将索引别的。

2

您必须在您的网站的根目录中创建一个robots.txt文件。

User-agent: * 
Disallow: qs 

# Googlebot allows regex in its syntax 
User-Agent: Googlebot 
Disallow: /*?qs* 
+0

我会建议在根级别谨慎。 – user2323922 2015-04-20 11:06:21