• 当前位置:主页 > 官方博客 > 正文

  • 11-13 2022

    使用robots.txt阻止常见的垃圾蜘蛛抓取站点方法

    2022-11-13 00:56:41,本文349字,阅读全文约需53秒。

    今天查看网站日志的时候,发现很多不认识的蜘蛛在抓取页面,有的一天抓取上万次,由于不知道这些蜘蛛是干什么的,特意百度查询了一下。

    什么是robots文件

    这里查询下两个抓取比较多的DotBot和MJ12bot蜘蛛。

    DotBot是Moz的网络爬虫程序,Moz旗下链接分析网站opensiteexplorer专门用来分析网站SEO外链数据,BotBot蜘蛛爬虫就是为Moz服务,在互联网上抓取大量的网页进行各种数据分析。

    MJ12bot是什么蜘蛛?MJ12bot是英国的一家老牌的搜索引擎营销网站Majestic的爬虫,他有专门的中文站,对外链查询等很多SEO数据查询提供数据支撑。

    看完感觉没有任何用处,还浪费网站流量,这里分享下怎么禁止这些蜘蛛的方法。

    robots.txt文件是告诉蜘蛛程序在服务器上什么文件是可以被查看的。

    我们在网站根目录下新建一个robots.txt文件,把下面的内容复制进去保存,里面是根据网站日志收集的一些没用蜘蛛,不会影响百度,搜狗,神马,头条,360等国内搜索引擎的抓取。

    User-agent: AhrefsBot
    Disallow: /
    User-agent: aiHitBot
    Disallow: /
    User-agent: BLEXBot
    Disallow: /
    User-agent: DotBot
    Disallow: /
    User-agent: SemrushBot
    Disallow: /
    User-agent: Uptimebot
    Disallow: /
    User-agent: MJ12bot
    Disallow: /
    User-agent: MegaIndex.ru
    Disallow: /
    User-agent: ZoominfoBot
    Disallow: /
    User-agent: Mail.Ru
    Disallow: /
    User-agent: SeznamBot
    Disallow: /
    User-agent: BLEXBot
    Disallow: /
    User-agent: ExtLinksBot
    Disallow: /
    User-agent: Researchscan
    Disallow: /
    User-agent: DnyzBot
    Disallow: /
    User-agent: spbot
    Disallow: /
    User-agent: YandexBot
    Disallow: /
    User-agent: MauiBot
    Disallow: /

    绝大多数的正规搜索引擎都遵守robots.txt的规则,过几天后,查看网站日志,已经看不见这些蜘蛛了。


    上一篇:夜难眠,看大美额敏灯光璀璨,人生似水流年青春已逝

    下一篇:珍惜光阴莫负时光,每天的努力和汗水都不会白费


    随机阅读:2023年终究快来了,承蒙时光不弃,至终都怀着一颗奋斗的心

    随机阅读:模板铺博客上线,记录生活点滴留下美好生活时光

    随机阅读:十一月你好,不负时光,愿好运悄然而来

    随机阅读:使用robots.txt阻止常见的垃圾蜘蛛抓取站点方法

    随机阅读:夜难眠,看大美额敏灯光璀璨,人生似水流年青春已逝

    随机阅读:珍惜光阴莫负时光,每天的努力和汗水都不会白费

    随机阅读:黑暗侵袭导演新作,巢穴2022中英双字观影推荐

模板铺✔官方博客 | XML | HTML