How to block a bot that is excessively visiting my site?

后端 未结 2 1130
醉梦人生
醉梦人生 2021-01-25 16:15

This bot doesn\'t respect nofollow noindex in robots.txt.

I have this in robots.txt:

User-agent: Msnbot
Disallow: /

User-Agent: Msnbot/2.0b         


        
相关标签:
2条回答
  • Here's what you need to do instead:

    Code:

    User-agent: *
    Disallow:
    
    User-agent: MSNbot
    Disallow: /
    

    The above code allows all robots except MSNbot.

    You can read more about the robots exclusion protocol here.

    for example, for bing.

    User-agent: MSNBot
    Disallow: /
    

    for google

    User-agent: googlebot
    
    Disallow: /
    

    if you want block all bots. use this.

    User-agent: *
    
    Disallow: /
    
    0 讨论(0)
  • 2021-01-25 16:57

    Based on Block by useragent or empty referer you could something like this in your .htaccess

    Options +FollowSymlinks  
    RewriteEngine On  
    RewriteBase /  
    SetEnvIfNoCase User-Agent "^Msnbot" ban_agent
    Deny from env=ban_agent
    
    0 讨论(0)
提交回复
热议问题