[tech] Referrer Checking for Hotlinking

loki loki at ucc.asn.au
Sat May 6 18:55:23 WST 2006


On Sat, May 06, 2006 at 05:07:52PM +0800, Davyd Madeley wrote:
>As an idea to try and cut down our traffic bill some more (or web
>backtraffic is ~1/11th of our outbound traffic) I knocked up a script to
>analyse our referrers to look for hotlinking.

Could you have a default .htaccess with something like the attached?
-------------- next part --------------
<Files .htaccess>
order allow,deny
deny from all
</Files>

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://loki.ucc.asn.au(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?ucc.asn.au/~loki(/)?.*$ [NC]
RewriteRule \.(gif|jpe?g|png|css|tpl|bmp|wmv|mpg|avi)$  [F,L,NC]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/tech/attachments/20060506/cbaca01f/attachment.pgp


More information about the tech mailing list