Button Button Button Button

I've noticed a while back that a good chunk of my bandwidth is going to a small number of people who are hotlinking to some of my photos. I can deal with people using some of my photos as backgrounds or hotlinking to thumbnail versions if they want to provide a link, but hotlinking to 800KB full-size image is pretty annoying.

In a bout of procrastination I have edited my .htaccess to specifically to redirect requests from myspace.com to an educational image, which I think I will keep permanently, since there are just too many myspaces people abusing this. I will also turn it on for Xanga for a few days. I am excluding the thumbnails, so that people can use those to link to images. If you want to know how it works, see the code below.

Meanwhile, let me rehash this for the hotlinkers:

  • Learn about hotlinking and why it is bad.
  • If you want to use a photo of mine on your page, figure where to put it. And make sure to provide a link to where you got it.
  • If you want to link to a photo of mine to direct your friends to it, you can hotlink to a small thumbnail.

The .htaccess code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} (myspace.com|xanga.com) [NC]
RewriteRule [0-9].jpg /etc/nohotlink.jpg
RewriteRule sized.jpg /etc/nohotlink.jpg

I put this in the /albums directory where my photos are.