Home :: Blog :: Articles :: Web-Hosting :: How to Block all requests from user agent using htaccess file

How to Block all requests from user agent using htaccess file

How to Block all requests from user agent using htaccess file
Category: Web-Hosting
Posted:
Views: 5563
Comments: 0 [Post]
Synopsis: You can Block user agent requests by creating a perfect .htaccess ban list, you can block all of unwanted user agents that will keep your server load down.

You can Block user agent requests by creating a perfect .htaccess ban list, you can block all of unwanted user agents that will keep your server load down.

## .htaccess Code :: BEGIN
## Block Bad Bots by user-Agent
SetEnvIfNoCase user-Agent ^FrontPage [NC,OR]
SetEnvIfNoCase user-Agent ^Java.* [NC,OR]
SetEnvIfNoCase user-Agent ^Microsoft.URL [NC,OR]
SetEnvIfNoCase user-Agent ^MSFrontPage [NC,OR]
SetEnvIfNoCase user-Agent ^Offline.Explorer [NC,OR]
SetEnvIfNoCase user-Agent ^[Ww]eb[Bb]andit [NC,OR]
SetEnvIfNoCase user-Agent ^Zeus [NC]

Order Allow,Deny
Allow from all
Deny from env=bad_bot

## .htaccess Code :: END




Comments on How to Block all requests from user agent using htaccess file

Start the conversation by being the first to comment!

Share comments

Your Name: *
Comments: *
Please Note: HTML Markup will be automatically removed.
The ability to post urls has been disabled by the site administrator.
*
Type the characters you see in the picture:

*