Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Apache forbids reptiles

Shulou Source: shulou.com Published: 2022-06-01 04:31:00 10月05日 Update

Apache

①, by modifying the.htaccess file

Modify.htaccess under the website directory and add the following code

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} (^$|FeedDemon|JikeSpider|Indy ) [NC]

RewriteRule ^(.*)$ - [F]

②. By modifying the httpd.conf configuration file

Find the following similar location, add/modify according to the following code, and then restart Apache:

DocumentRoot /home/wwwroot/xxx

SetEnvIfNoCase User-Agent ".* (FeedDemon|JikeSpider|Indy )" BADBOT

Order allow,deny

Allow from all

deny from env=BADBOT

Tags: Code file location directory website configuration crawler Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info macOS Microsoft Apple Xiaomi