Cách này sẽ chặn badbot ở vhost. Áp dụng cho apache, nginx_apache. Không áp dụng cho nginx thuần và openlitespeed
vi /etc/httpd/conf/extra/httpd-includes.conf
Sau đó copy cấu hình sau dán vào file httpd-includes.conf
và lưu lại
SetEnvIfNoCase User-Agent "MJ12bot/v1.4.8" bad_bots
SetEnvIfNoCase User-Agent "MJ12bot/v1.4.4" bad_bots
SetEnvIfNoCase User-Agent "SemrushBot/6~bl" bad_bots
SetEnvIfNoCase User-Agent "SemrushBot/7~bl" bad_bots
SetEnvIfNoCase User-Agent "DotBot/1.1" bad_bots
SetEnvIfNoCase User-Agent "DotBot/1.2" bad_bots
SetEnvIfNoCase User-Agent "MegaIndex.ru/2.0" bad_bots
SetEnvIfNoCase User-Agent "AspiegelBot" bad_bots
SetEnvIfNoCase User-Agent "PetalBot" bad_bots
SetEnvIfNoCase User-Agent "BLEXBot/1.0" bad_bots
SetEnvIfNoCase User-Agent "serpstatbot/2.1" bad_bots
SetEnvIfNoCase User-Agent "AhrefsBot/7.0" bad_bots
SetEnvIfNoCase User-Agent "Amazonbot/0.1" bad_bots
SetEnvIfNoCase User-Agent "CensysInspect/1.1" bad_bots
SetEnvIfNoCase User-Agent "YandexMarket/2.0" bad_bots
SetEnvIfNoCase User-Agent "YisouSpider" bad_bots
SetEnvIfNoCase User-Agent "Bytespider" bad_bots
SetEnvIfNoCase User-Agent "Amazonbot" bad_bots
SetEnvIfNoCase User-Agent "DotBot" bad_bots
SetEnvIfNoCase User-Agent "my-tiny-bot" bad_bots
SetEnvIfNoCase User-Agent "python-requests" bad_bots
SetEnvIfNoCase User-Agent "curl/7.68.0" bad_bots
SetEnvIfNoCase User-Agent "curl/7.54.1" bad_bots
SetEnvIfNoCase User-Agent "ClaudeBot" bad_bots
SetEnvIfNoCase User-Agent "Go-http-client/2.0" bad_bots
SetEnvIfNoCase User-Agent "ZoominfoBot" bad_bots
SetEnvIfNoCase User-Agent "CensysInspect/1.1" bad_bots
SetEnvIfNoCase User-Agent "SemrushBot/7~bl" bad_bots
SetEnvIfNoCase User-Agent "CriOS/113.0.5672.121" bad_bots
SetEnvIfNoCase User-Agent "ByteLocale/vi-VN" bad_bots
SetEnvIfNoCase User-Agent "BytedanceWebview/d8a21c6" bad_bots
SetEnvIfNoCase User-Agent "SamsungBrowser/23.0" bad_bots
SetEnvIfNoCase User-Agent "Trident/5.0" bad_bots
SetEnvIfNoCase User-Agent "coccocbot-web/1.0" bad_bots
SetEnvIfNoCase User-Agent "Go-http-client/1.1" bad_bots
SetEnvIfNoCase User-Agent "coccocbot-image/1.0" bad_bots
SetEnvIfNoCase User-Agent "bingbot/2.0" bad_bots
SetEnvIfNoCase User-Agent "ClaudeBot/1.0" bad_bots
SetEnvIfNoCase User-Agent "Applebot/0.1" bad_bots
<Location />
Order Allow,Deny
Deny from env=bad_bots
Allow from all
</Location>
Cuối cùng khởi động lại httpd