zoukankan      html  css  js  c++  java
  • 正确robots写法,解决百度搜索不显示缩略图问题

        网站上线http://zhimo.yuanzhumuban.cc/有一年左右时间了,百度搜索显示略缩图少之又少,通过自己这几天的观察发现。

       结合百度站长平台的 robots 工具和抓取诊断工具检查后,发现果然是 robots 误禁封造成的! 百度索引变动一直以慢著称,所以 robots 写错了也不会在十天半个月突显出来,真是坑的一 B! 通过抓取诊断工具,发现普通图片可以抓取,带参数的图片就抓取失败。经过多次测试,发现问题出现在 Allow: /*.png$ 这种写法,是以 png 结尾,尾部不再包含其他任何字符,因此,上文提到的 PHP+Nginx 缩略图形式 x.png?w=480

       附上个人配置的robots,仅供参考:

       

    # Robots
    User-agent: Baiduspider
    Allow: /*.png$
    Allow: /*.jpg$
    Allow: /*.jpeg$
    Allow: /*.gif$
    Allow: /*.bmp$
    Allow: /*.bmp$
    Allow: /skin/pengcheng1688/*
    Disallow: /api/
    Disallow: /install/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    Sitemap: http://zhimo.yuanzhumuban.cc/sitemaps.xml
    Sitemap: http://zhimo.yuanzhumuban.cc/hotkey/
    Sitemap: http://zhimo.yuanzhumuban.cc/feed/rss.php?mid=5
    Sitemap: http://zhimo.yuanzhumuban.cc/feed/rss.php?mid=12
    Sitemap: http://zhimo.yuanzhumuban.cc/feed/rss.php?mid=21
    
    User-agent: Baiduspider-image
    Allow: /*.png$
    Allow: /*.jpg$
    Allow: /*.jpeg$
    Allow: /*.gif$
    Allow: /*.bmp$
    Allow: /*.bmp$
    Allow: /skin/pengcheng1688/*
    Disallow: /api/*
    
    
    User-agent: Googlebot
    Sitemap: http://zhimo.yuanzhumuban.cc/sitemaps.xml
    Sitemap: http://zhimo.yuanzhumuban.cc/hotkey/
    Sitemap: http://zhimo.yuanzhumuban.cc/feed/rss.php?mid=5
    Sitemap: http://zhimo.yuanzhumuban.cc/feed/rss.php?mid=12
    Sitemap: http://zhimo.yuanzhumuban.cc/feed/rss.php?mid=21
    Disallow: /api/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    
    
    User-agent: googlebot-image
    Allow: /*.png$
    Allow: /*.jpg$
    Allow: /*.jpeg$
    Allow: /*.gif$
    Allow: /*.bmp$
    Allow: /*.bmp$
    Allow: /skin/pengcheng1688/*
    Disallow: /api/
    Disallow: /member/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    
    User-agent: Sogou web spider
    Sitemap: http://zhimo.yuanzhumuban.cc/sitemaps.xml
    Disallow: /api/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    
    User-agent: Sogou inst spider
    Sitemap: http://zhimo.yuanzhumuban.cc/sitemaps.xml
    Disallow: /api/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    
    User-agent: Sogou spider2
    Sitemap: http://zhimo.yuanzhumuban.cc/sitemaps.xml
    Disallow: /api/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    
    User-agent: Sosospider
    Sitemap: http://zhimo.yuanzhumuban.cc/sitemaps.xml
    Disallow: /api/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    
    User-agent: yisouspider
    Disallow: /api/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    
    User-agent: 360Spider
    Sitemap: http://zhimo.yuanzhumuban.cc/sitemaps.xml
    Disallow: /api/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    
    User-agent: *
    Disallow: /api/
    Disallow: /install/
    Disallow: /member/
    Disallow: /skin/
    Disallow: /template/
    Disallow: /upgrade/
    Disallow: /comment/*
    Disallow: /?*
    Disallow: /*?*
    Disallow: /api/*
    

      

         

       

  • 相关阅读:
    如何封装一个Ajax函数
    了解Ajax及Ajax如何发送请求
    jQuery的animate动画方法及动画排队问题解决
    jQuery的几种显示隐藏方法
    冲鸭!电瓶车
    Qt中使用HTTPS
    空非空
    河西走廊
    “财富自由”者之殇
    说鞋
  • 原文地址:https://www.cnblogs.com/68xi/p/9777631.html
Copyright © 2011-2022 走看看