Hot-linking not allowed..

# on November 24th 2006 at 11:43 am in General, Random Rantings

As I noticed a lot of the bandwidth of this website is going to ‘waste’ because some people like to use images stored on this server in their signatures or posts on other forums, I tinkered around a bit with PHP and Apache’s Rewrite Engine and cooked up a configuration that ought to reduce this waste in the future. (There’s probably stuff out there that already does this, but I was too lazy to look around and enough of a stubborn technician to figure it out myself.)

I usually make a local copy of a (image) file that I include in my posts — because, well, I don’t think it’s nice relying / abusing another persons bandwidth — yeh — at the risk of getting hotlinked to. Those files all reside in a subdirectory on this server.

I could make a list of sites to mark as ‘bad’, but the only way to check on what site the image is linked from, is by checking the oh-so untrustworthy Referrer-header. So that wouldn’t work, I had to pick another, less, untrustworthy header… :P

Basically this new configuration will make people not browsing this site get served another resource (I was thinking goatse but hey — even I think that may be a bit over-the-top). I cooked up a small image with the GIMP which simple states that ‘hot-linking is not allowed‘, but later decided a 404 would do just fine as well.

Although this is surely not as effective as goatse — I’m sure those hotlinks will disappear over time…

Oh and if, for some reason, this broke something I’m not yet aware of — please let me know. :)

- Navaho Gunleg
comment on this article

Notice: All comments are moderated. Your comment will appear once approved.

© 2005-2010. All remarks and opinions on this site are the intellectual property of Navaho Gunleg, unless specified otherwise. If you find anything offensive or otherwise insulting, just close the damn window; there are far more serious issues in this world to get upset about.