I run a lot of different pieces of software to try and figure out what’s going on with my website. Pair.com gave me the choice of Webalizer or Analog. Plus I’ve got Sitemeter and ExtremeTracking javascripts loading at the bottom of the pages. Not to mention my Refer page. Maybe it’s overkill but this site is still in the “building” stage. How do most people find my site? Who are my return visitors? What pages are the most popular? That kind of thing.
So when I was checking out my stats for the first two days of August I was annoyed to find forum avatar leechers—people who had directly linked to the images on my site for display on another site instead of downloading them and providing them on their own. It’s just rude. They are eating my bandwidth. Not enough to cause me overage trouble but it’s still shows a complete disregard for me. Basically every ISP on the planet gives out a bit of webspace with your account. Not to mention the tons of free places. How hard is it to save that image to the desktop and upload it to your own server?
Plus it totally blows away my legitimate tracking. Especially when people use them as forum avatars on popular sites. (And when they post alot.) One girl in Australia who was linking to a picture of Barbarella from my old Right Turn Clyde site managed to rack up 2200 hits on that picture in 2 days! And some guy in Italy had 1000 hits on a picture of The Donnas from that old site of mine. Of course those rocket to the top of all the lists in my tracking knocking out stuff that I really want to know about.
So I decided to get even using Apache’s nifty little mod_rewrite:
I added this to my .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www.vogue.com.au/forum/.* [NC]
RewriteRule .*barbarella.jpg$ /images/i_steal_bandwidth.gif
RewriteCond %{HTTP_REFERER} ^http://www.toronews.net/forum/.* [NC]
RewriteRule .*donnas5.jpg$ /images/i_steal_bandwidth.gif
So now Ms. Australia looks like this:
And this guy is so bad-ass I almost crapped myself:
You can find lots of solutions on websites to block all image requests that don’t come from your own site, but I use my site to serve images and files for lots of different things—my own forum avatars on numerous sites, example screenshots for software that I beta test, etc. It would be a real pain to have to continually go in and add new sites for access. So I set this up to just block those two. Of course there are others leeching from me. But those were the worst.
And of course this solution doesn’t solve my tracking problem. But revenge can be sweet. I’ll block them totally in a week or two:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www.vogue.com.au/forum/.* [NC]
RewriteRule .*(jpg|JPG|gif|GIF)$ - [F]
RewriteCond %{HTTP_REFERER} ^http://www.toronews.net/forum/.* [NC]
RewriteRule .*(jpg|JPG|gif|GIF)$ - [F]