Random & Tech 24 Aug 2005 10:50 am

Hot links

Rather than referring to “not safe for work” links, “hotlinking” is the practice of embedding, in one’s web pages, images (or other multimedia content) that comes from an unrelated site, without permission (or even notification). The effect is that the owners of the web site that hosts the images pay for the bandwidth used when someone views the pages that belong to the “hotlinker” (which gets a free ride) without getting anything in exchange; not even visibility. It may also be a copyright violation, depending on the terms of use of the site in question.

All this is to say that yesterday I looked at the stats for this site and noticed several hits with referrals coming from an auction site; they were all requests for one particular image. As you can guess, one of the auctioneers decided that one image from my site would make a cool avatar for him.

Now, if you scroll down to the bottom of this page, you will see a “Creative Commons” logo. That means that the content from this site can be freely copied and used for any purpose whatsoever, provided that the author (that would be me) is acknowledged.

However, I’m not a free hosting provider. Had that user copied the image somewhere else and used it, I’d be cool with that (and I probably wouldn’t ever find out about it, anyway). But using my bandwidth and not acknowledging authorship is a little too much.

So, after a quick fiddle with my .htaccess and thanks to mod_rewrite, that user’s avatar is now a red-on-white block of text saying “this user steals images”. I don’t think that’ll improve the chances of him selling whatever it is he’s selling.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} ^http://(www\.)?[auctionsite].com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?myspace.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?[fotologsite].com.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.netwhatever.com/hotlink.png [R,L]

At first I considered blocking all hotlinking, but that would break image search engines (such as Google Images), and I didn’t want that. So, I’m limiting it to known offenders (I also found one guy using the same image as an avatar in myspace.com, and another one had a different photo as his background image in a fotolog). If it gets out of hand, though, I’ll white-list Google, Yahoo etc. and block everything else.

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply