Archive for the 'Web Site Stuff' Category

Dec 18 2005

Block Hotlinking with .htaccess

Published by D'Arcy Gregoire under Web Site Stuff

Here’s something that I’ve just added to one of my sites, www.gogosuperfun.com, that some folks may find useful. It’s intended to stop people from hotlinking images and thus stealing your bandwidth.
Basically, it just blocks any domain, other than your own, from accessing filetypes that you specify.

mod_rewrite code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ […]

No responses yet