How I stopped a bandwidth thief

As you may have read, a few days ago I found that I was having a few issues with bandwidth theft with people hotlinking to images on my auto blog without permission. I decided I'd have some fun for a couple of days by replacing the hotlinked images with some non-auto, border line inappropriate, images.

Yesterday I decided I'd had enough fun and started doing some research into how to prevent hotlinking through editing the htaccess file. I "google'd", asked questions of people smarter than me, and scratched my head. All the usual stuff. I'd became quite partial to one of my bandwidth thief banners, and wanted to implement a solution that would incorporate the banner somehow.

The solution I settled on (see code below), was to block requests for images from outside sources, and serve up the banner of my choice in place of the actual request.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domainName\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/bandwidthThief.jpe [L]

In other words, if anyone attempts to hotlink to any images (jpg, gif, bmp, or png) on my server, instead of displaying the requested image, they will instead display my banner of choice.

Simplifying it further, the bandwidth thief thinks they are getting an image of a Subaru WRX STi, but are instead served up a massive set of bulls testicles (see below). I love the internet. If you want to use the "Bull Balls" solution, feel free to copy the image below (NO HOTLINKING!!) :p A link back would be appreciated.

Band Width Thief

20 Comments on How I stopped a bandwidth thief

  1. “Inline linking is the placing of a linked object, often an image, from one site into a web page belonging to a second site. The second site is said to have an inline link to the site where the object is located. Inline linking is also known as hotlinking, leeching, direct linking or bandwidth theft.”

  2. Nice idea that with the script. I had some problems in the past and had some fun changing the images… but its time consuming 🙁
    My host has the option of hotlink protection so i have no much troubles.

  3. Previously the effects were that other sites were hotlinking directly to some of the car images hosted on my site. The pics were between 40 and 100kb each. So if they hotlink to a few images, they could be stealing 1mb of bandwidth at a time.

    So now, instead of getting the car images, they get the balls (which is about 7kb). I could have blocked images altogether, but for the time being I’d rather serve them up the balls.

  4. awesome cal dude, i must read your blog more often! bandwith theives sometimes drain my BW big time, if they link on forums and stuff then it can get major traffic

  5. I adopted a slightly different approach although it is slightly more “manual”. Basically, I give a 403 (access denied) response to requests that come from domains I have detected as in-line linkers or hitting me with referrer spam. The write-up for Apache is here (shameless plug…sorry):

    I like your method with the balls image – that is too funny! Kudos to your admin l33t-ness 😉

  6. I couldn’t believe I hadn’t commented on this article… I was just looking at your highest rated posts and found this beauty. This article is how I found your website, through a search on google images… i thought it was so hilarious i clicked on it… well now it’s got an additional 5 star rating!

  7. So, if someone were to ask for permission, you’d say yes, despite the loss of about 1mb? I would like to be able to put 100% original content up when seeking out pics or something that adds some spice, yet find that it is nearly impossible as I am not a pro-photographer/artist/have access to fab programs to create pics, etc. So, if I want to add something cool, I seek out the internet’s help.

    I would like to think that people find it flattering at least in some way that I would use a pic that they took amongst the many others. Nonetheless, I had no idea this meant slowing down bandwidth access. Where is the happy medium?

  8. Elisa – If someone wants to use an image they could download it, and place it on their own server, and credit the source if appropriate. Use the image if you want, but just don’t hotlink it, host it from your own server.

    It’s not an issue of using images, its an issue of someone using up bandwidth that I’m paying for.

5 Trackbacks & Pingbacks

  1. The quick and easy way to get started with DealDotCom | Swollen Pickles
  2. November 2007 goal update | Swollen Pickles
  3. What is Inline linking? | Malagent's Sandbox
  4. Another Birthday Present to you… | Aussie Bloggers
  5. Hotlinking |

Leave a Reply

Your email address will not be published.