【问题标题】:EHow to Disallow few list of URL crawled by google crawler using robots.txt如何禁止谷歌抓取工具使用 robots.txt 抓取的少数 URL 列表
【发布时间】:2015-05-18 10:44:24
【问题描述】:

我有几个页面和网址不想被 Google 抓取工具抓取。

我知道这可以通过 robots.txt 完成。我在 Google 上搜索,发现这种方式需要将 robots.txt 中的所有内容安排为禁止爬虫,但我不确定这样做是否正确。

User-Agent: *
Disallow: /music?
Disallow: /widgets/radio?

Disallow: /affiliate/
Disallow: /affiliate_redirect.php
Disallow: /affiliate_sendto.php
Disallow: /affiliatelink.php
Disallow: /campaignlink.php
Disallow: /delivery.php

Disallow: /music/+noredirect/
Disallow: /user/*/library/music/
Disallow: /*/+news/*/visit
Disallow: /*/+wiki/diff

# AJAX content
Disallow: /search/autocomplete
Disallow: /template
Disallow: /ajax
Disallow: /user/*/tasteomatic

我可以这样提供网址吗?我的意思是,我可以将完整的 URL 指定为不允许吗?

Disallow: http://www.bba-reman.com/admin/feedback.htm

编辑

我当前的 robots.txt 条目如下所示

User-Agent: *
Disallow: /CheckLogin
Disallow: /DTC.pdf
Disallow: /catalogue/bmw.htm
Disallow: /auto-mine/bmw/index.htm
Disallow: /forums/parent.Jmp('i100')
Disallow: /forums/parent.Jmp('i040')
Disallow: /forums/CodeDescriptions.html
Disallow: /forums/parent.Jmp('i050')
Disallow: /forums/parent.Scl('000','24601')
Disallow: /forums/parent.Jmp('i030')
Disallow: /catalogue/peugeot.htm

可以吗.....告诉我。谢谢

【问题讨论】:

标签: url robots.txt googlebot


【解决方案1】:

Disallow 字段的值始终是 URL path 的开头

所以如果你的 robots.txt 可以从http://example.com/robots.txt 访问,并且它包含这一行

Disallow: http://example.com/admin/feedback.htm

那么这样的 URL 将被禁止:

  • http://example.com/http://example.com/admin/feedback.htm
  • http://example.com/http://example.com/admin/feedback.html
  • http://example.com/http://example.com/admin/feedback.htm_foo
  • http://example.com/http://example.com/admin/feedback.htm/bar

所以如果你想禁止 URL http://example.com/admin/feedback.htm,你必须使用

Disallow: /admin/feedback.htm

会阻止这样的 URL:

  • http://example.com/admin/feedback.htm
  • http://example.com/admin/feedback.html
  • http://example.com/admin/feedback.htm_foo
  • http://example.com/admin/feedback.htm/bar

【讨论】:

  • 我只是发布了一个编辑部分。请查看并告诉我可以吗?
  • @Mou:语法上是正确的。但是,只有您才能知道它是否达到了您想要达到的效果。
猜你喜欢
  • 2016-01-25
  • 2022-12-31
  • 1970-01-01
  • 2020-03-21
  • 2022-11-02
  • 2016-04-22
  • 2015-04-22
  • 1970-01-01
  • 2016-03-06
相关资源
最近更新 更多