Welcome to WebmasterWorld Guest from 54.205.115.177

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

BrowserMatch

Another way to block User-Agents on Apache

   
12:09 pm on Oct 20, 2001 (gmt 0)

10+ Year Member



BrowserMatch and BrowserMatchNoCase [httpd.apache.org] are very effective in blocking User-Agents on a server wide basis and they will work even if mod_rewrite is not enabled.

The syntax is BrowserMatch ^User-Agent env-variable

Examples using environment variables mail_bots and bad_bots

# Block email extraction bots
BrowserMatch ^ExtractorPro mail_bots
BrowserMatch ^EmailSiphon mail_bots
BrowserMatch ^EmailWolf mail_bots
BrowserMatch ^EmailCollector mail_bots
BrowserMatch ^CherryPicker mail_bots
BrowserMatch ^WebEMailExtractor mail_bots

# Block bandwidth suckers and pests
BrowserMatch ^LinkWalker bad_bots
BrowserMatch ^WhizBang bad_bots
BrowserMatch ^MIIxpc bad_bots
BrowserMatch ^MFC_Tear bad_bots
BrowserMatch ^DIIbot bad_bots
BrowserMatch ^ia_archiver bad_bots
BrowserMatch ^Wget bad_bots

In the above example the following needs to be added to .htaccess for directories where you want to deny access for the bad bots.

deny from env=mail_bots
deny from env=bad_bots

For Apache Versions prior to 1.3.13 you will need access to the Apache configuration files. BrowserMatch directives are added to srm.conf or httpd.conf A 500 error page will be produced if used in .htaccess

With the latest versions of Apache BrowserMatch will work in srm.conf or httpd.conf and .htaccess files.

Apache will need to be restarted if they are added to srm.conf or httpd.conf

5:27 pm on Oct 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nice tip, Gorufu, thanks.