![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Femcams.com
Industry Role:
Join Date: Jul 2011
Location: bjcam.com
Posts: 12,220
|
.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> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Mar 2015
Posts: 127
|
Code:
RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^.*(AhrefsBot|MJ12bot|Yandex).*$ [NC] RewriteRule .* - [F,L]
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Bollocks
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Femcams.com
Industry Role:
Join Date: Jul 2011
Location: bjcam.com
Posts: 12,220
|
Quote:
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 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed Chicago Pimp
Industry Role:
Join Date: Aug 2004
Location: Chicago
Posts: 7,100
|
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. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Femcams.com
Industry Role:
Join Date: Jul 2011
Location: bjcam.com
Posts: 12,220
|
Nice i will have a look
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Jun 2012
Location: Canada
Posts: 1,338
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
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: / |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Femcams.com
Industry Role:
Join Date: Jul 2011
Location: bjcam.com
Posts: 12,220
|
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] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
|||||||
|
|||||||
Bookmarks |
Tags |
.htaccess, bots, setenvifnocase, found, deny, env=bad_bot, allow, deny, bad_bot, user-agent, block, bad, blocking, crap, successful, mj12bot, ahrefsbot, yandexbot |
Thread Tools | |