Feed on
Posts
Comments

针对百度的robots.txt写法

由于百度对The Robots META标签支持不是很好,所以一般在robots.txt优化方面我们是要特殊的照顾一下百度。OK,这里艾瑞好好的讲一讲针对百度的robots.txt写法.针对百度的robots.txt写法

这里我以一个曾经问过ZAC的问题来给大家解释!

       我的目的:       让除百度之外的所有蜘蛛不爬目录 wwwroot/b
                                    让百度不爬目录 wwwroot/b 和wwwroot/a
 
现在有四种写法,请选择正确答案:
A.、
 
User-agent: *
Disallow: /b

User-agent: Baiduspider
Disallow: /a

 
B、
 
User-agent: Baiduspider
Disallow: /a

User-agent: *
Disallow: /b

 
C、
 
User-agent: *
Disallow: /b

User-agent: Baiduspider
Disallow: /a

Disallow: /b
 
D、
 
User-agent: Baiduspider
Disallow: /a
Disallow: /b
 
User-agent: *
Disallow: /b
答案是A或C.
  
  

3 Responses to “针对百度的robots.txt写法”

  1. SEO小工 说:

    C和D是对的。
    User-agent的顺序无关,抓取程序是先是匹配User-agent,用就用这一段的规则。没有才是用 * 的。
    而不是有先后顺序,或者缺省的 * 总是可用。而User-agent这一段内的匹配是由上面下,只要符合就结束。
    见:http://www.shyedu.net/it-website/robots.txt-111.html

    [回复]

  2. 爱锵锵 说:

    弱问一句
    为什么我的博客
    yahoo 一页也不收录呢?
    yahoo反向链接都2000多了。。。

    [回复]

    Seog 回复:

    Pages (385) Inlinks (6,794)

    现在收录不错啊

    [回复]

Leave a Reply