0

block user agent in apache web server

Need to block user agent in apache web server say

"libwww-perl"

which is not needed??

Apache Add a comment
ajinfernando
asked Sep 29 2018

Answer

0

Assuming .htaccess is already enabled on your server (it is on most servers running Apache), add the following near the very top to block this user-agent from accessing your site.

cat .htaccess
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_USER_AGENT} ^libwww-perl [NC]
  RewriteRule .* - [F,L]
</IfModule>
Add a comment
linuxhelp
asked Jan 29 2019
edited Jan 29 2019
Post your Answer