Shop Mobile More Submit  Join Login
×

Stop Stealing My Bandwidth!

Journal Entry: Fri Jan 5, 2007, 10:42 AM
I checked my server logs last night, just to see if there was anything interesting. I use two different domains, one for my blog and one for images I use on forums and the like, so the logs for mi6.nu, my images domain are like a breadcrumb trail of my last month's browsing. I was pretty surprised to see a few URLs I'd never heard of as the referrers. A finnish site about Lordi was one and MySpace.com was the other. I hate MySpace, and there's no way I'd have wasted my bandwidth hosting pictures for it. The images being linked was Contemplating Existence, a wallpaper I made last year. Some Idiot was using the image as his background. It's great that he liked my wallpaper but firstly it's my property, he can't use it without my permission, and secondly, it's over 200KB, and was loaded 350 times in December. That's 65MB of bandwidth I've paid for!



I decided to teach the leech a lesson using .htaccess, which lets you serve up a different image for specified referrers. Inspired by a recent blog post I'd read, I thought the Goatse pic would be a good choice. For anyone that doesn't know, Goatse was a site available at the turn of the millenium which scarred millions of impressionable AOL kiddies. Now whenever someone from an external site tries to use one of those images, they'll get a nice surprise. Let that be a lesson to anyone else who's thinking of leeching my bandwidth! The MySpace guy's changed his background, but the site about Lordi's still using that dodgy background.


For anyone that's interested, this is the .htaccess file for Apache. The second and fourth lines tell apache to apply the rule for any host other than leghumped.com, the third and fifth lines tell it to serve up the no-hotlinking image instead of the requested URL.

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^leghumped.com/(.*)$ [NC]
    RewriteRule ^images/lordi.png$ images/nolink.png
    RewriteCond %{HTTP_REFERER} !^leghumped.com/(.*)$ [NC]
    RewriteRule ^images/tesla.jpg$ images/nolink.png


For anyone that's interested, this is the .htaccess file for Apache. The second and fourth lines tell apache to apply the rule for any host other than leghumped.com, the third and fifth lines tell it to serve up the no-hotlinking image instead of the requested URL.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^leghumped.com/(.*)$ [NC]
RewriteRule ^images/lordi\.png$ images/nolink.png
RewriteCond %{HTTP_REFERER} !^leghumped.com/(.*)$ [NC]
RewriteRule ^images/tesla\.jpg$ images/nolink.png

Artist Wanted

Journal Entry: Thu Jan 4, 2007, 9:05 AM
I'm looking for someone who can draw to knock up a quick logo for my site, leghumped.com leghumped.com. If you have any sort of artistic talent, or just a spare five minutes, leave me a comment or PM, I'd really like to hear from you!


  • Reading: JavaScript for Web Developers
  • Playing: Coding a PHP calendar

Subscription

Journal Entry: Sun Dec 31, 2006, 1:31 AM
I finally bought a subscription after months of convincing myself I wouldn't use it. Now I have a nifty '=' prefix :P




  • Eating: Leftover mince pies

Disneyland here I come!

Journal Entry: Fri Aug 11, 2006, 7:28 AM
I'm going to Disneyland in Florida on 11th July, so I'll be gone for a couple of weeks. I'll post pics when I get back.


Free Subscription

Journal Entry: Thu Nov 10, 2005, 6:55 AM
Woopdeedoo, I've got a free one week DA subscription. Now to see what all the extra subscription money gets you...