• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Block selected UserAgents for all vhosts

Azurel

Silver Pleskian
I want block a few bots and crawlers, which not respect robots.txt.
I think the best way is to create a new apache config-file in "/etc/httpd/conf.d/block_useragents.conf" and reload apache?

Content of block_useragents.conf:
<Directory "/var/www/vhosts/">
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^(Agent1|Agent2|Agent3) [NC]
RewriteRule .* - [F]
</Directory>

Would this work for all vhosts? Is here a better way?
 
Last edited:
 
Thanks for this link. Helps a lot.
BUT what about "missing" user-agents? In my log files I found dozens of requests with "no" or "unknown" user-agent. How to add this to the linked list?
 
Back
Top