homepage Welcome to WebmasterWorld Guest from 23.21.9.44
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
BrowserMatch
Another way to block User-Agents on Apache
Gorufu




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

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

 

sugarkane




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

Nice tip, Gorufu, thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved