Apache::RefererBlock - block request based upon referer header
In your Apache configuration file, add something like
PerlModule Apache::RefererBlock PerlFixupHandler Apache::RefererBlock RefBlockMimeTypes image/gif image/jpeg RefBlockAllowed http://www.mydomaine.com http://mydomaine.com RefBlockRedirect http://www.badguyse.com http://www.badguyse.com/images/bigpicture.gif RefBlockRedirect http://www.realbadguyse.com http://www.xxx.xxx/samples/tts.jpg RefBlockDebug On
All directives are optional.
Apache::RefererBlock will examine each request. If the MIME type of the requested file is one of those listed in RefBlockMimeTypes, it will check the request's "Referer" header. If the referrer starts with one of the strings listed in RefBlockAllowed, access is granted. Otherwise, if there's a RefBlockRedirect directive for the referrer, a redirect is issued. Otherwise, a "Forbidden" (403) error is returned.
Requests with an empty Referer header will be granted, to accomodate old browsers.
The latest version can be fetched from <http://www.logilune.com/eric/RefererBlock.html>.
Eric Cholet, <cholet@logilune.com>
Copyright (c) 1998 Eric Cholet.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Apache::RefererBlock, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::RefererBlock
CPAN shell
perl -MCPAN -e shell install Apache::RefererBlock
For more information on module installation, please visit the detailed CPAN module installation guide.