.htaccess for blocking bad bots

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AllAboutCams
    Femcams.com
    • Jul 2011
    • 12234

    #1

    .htaccess for blocking bad bots

    Im getting way too much crap from the bots
    YandexBot
    AhrefsBot
    MJ12bot

    Anyone successful block them with a .htaccess

    i found this one below

    SetEnvIfNoCase User-Agent .*sitebot.* bad_bot
    <Limit GET POST HEAD>
    Order Allow,Deny
    Allow from all
    Deny from env=bad_bot
    </Limit>
    Binance - Blockchain and Crypto Asset Exchange
    Chaturbate make money in cams
  • Gallery-Traffic
    Confirmed User
    • Mar 2015
    • 127

    #2
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} ^.*(AhrefsBot|MJ12bot|Yandex).*$ [NC]
    RewriteRule .* - [F,L]

    Comment

    • redwhiteandblue
      Bollocks
      • Jun 2007
      • 2793

      #3
      Those bots are harmless anyway, why do you want to block them? The malicious ones don't identify themselves in the UA.
      Interserver unmanaged AMD Ryzen servers from $73.00

      Comment

      • AllAboutCams
        Femcams.com
        • Jul 2011
        • 12234

        #4
        Originally posted by Gallery-Traffic
        Code:
        RewriteEngine On
        RewriteCond %{HTTP_USER_AGENT} ^.*(AhrefsBot|MJ12bot|Yandex).*$ [NC]
        RewriteRule .* - [F,L]
        Thank you i will try it

        Originally posted by redwhiteandblue
        Those bots are harmless anyway, why do you want to block them? The malicious ones don't identify themselves in the UA.
        Because im getting a few emails every day saying that mysql has crashed so i asked my host and they said its because of bots
        Binance - Blockchain and Crypto Asset Exchange
        Chaturbate make money in cams

        Comment

        • ErectMedia
          Confirmed Chicago Pimp
          • Aug 2004
          • 7100

          #5
          I've used http://www.CloudFlare.com which seems to be used by more people but was more of a good CDN without much of anything being blocked out in terms of security as I tested the free and the $20/month Pro plan.

          Currently using http://www.Incapsula.com free plan which is blocking more malicious shit out than the $20/month Pro plan from CloudFlare. Haven't tried a paid option here yet though and not sure I will as the free plan combined with a hardened server is working well. Currently have (444) domains running through them.

          So if just looking for a popular CDN go CloudFlare.
          If looking for a popular CDN with better security built in I'd go Incapsula.

          Comment

          • AllAboutCams
            Femcams.com
            • Jul 2011
            • 12234

            #6
            Nice i will have a look
            Binance - Blockchain and Crypto Asset Exchange
            Chaturbate make money in cams

            Comment

            • hdbuilder
              Confirmed User
              • Jun 2012
              • 1338

              #7
              There you go, just find their user agents on the net and replace:

              Code:
              # Block bad spiders
              RewriteCond %{HTTP_USER_AGENT} Baiduspider [NC,OR]
              RewriteCond %{HTTP_USER_AGENT} Sogou [NC,OR]
              RewriteCond %{HTTP_USER_AGENT} GSLFbot [NC,OR]
              RewriteCond %{HTTP_USER_AGENT} Wotbox [NC,OR]
              RewriteCond %{HTTP_USER_AGENT} MJ12bot [NC,OR]
              RewriteCond %{HTTP_USER_AGENT} Sosospider [NC,OR]
              RewriteCond %{HTTP_USER_AGENT} Ezooms [NC,OR]
              RewriteCond %{HTTP_USER_AGENT} Yandex
              RewriteRule ^.* - [F,L]

              ROBO SCRIPTS | WP CAM PLUGIN - Scripts To Promote Cam Sites - Chaturbate, BongaCams, Streamate, LiveJasmin, Stripchat...

              The Cam Site Builder, The Cam Multi Site Builder -> MULTIPLE CAM SITES IN ONE

              Comment

              • rowan
                Too lazy to set a custom title
                • Mar 2002
                • 17393

                #8
                For well behaved bots, it's better to block them via robots.txt in your main web directory. Apart from the occasional re-fetch of robots.txt (to check if you've changed your mind) you shouldn't see them in your logs ever again

                Code:
                User-agent: Yandex
                Disallow: /
                
                User-agent: MJ12bot
                Disallow: /
                
                User-agent: AhrefsBot
                Disallow: /

                Comment

                • AllAboutCams
                  Femcams.com
                  • Jul 2011
                  • 12234

                  #9
                  This is what i settled on

                  RewriteEngine On
                  RewriteCond %{HTTP_USER_AGENT} AhrefsBot [OR]
                  RewriteCond %{HTTP_USER_AGENT} MJ12bot [OR]
                  RewriteCond %{HTTP_USER_AGENT} Yandex [OR]
                  RewriteCond %{HTTP_USER_AGENT} SemrushBot
                  RewriteRule . - [F,L]
                  Binance - Blockchain and Crypto Asset Exchange
                  Chaturbate make money in cams

                  Comment

                  Working...