Enough hot-linking already

A few weeks ago I looked through my server’s log-files and was almost a bit shocked to find out that a hell of a lot of traffic is generated by just a few images on my site. Most of those images are hot-linked into profiles on myspace.com. There are also a lot of forums and other sites where references to images on my site appear.

I tried to contact a most of the places where my images were used and asked them to either remove the link or at least make a local copy of the image so that it would not affect my bandwidth. I did not get a single response from those people I contacted and decided to make changes on my end to work against the hot-linking.

Since last week I have the following in several places on my (Apache) server:

   RewriteEngine on
   RewriteCond %{REQUEST_URI}  !.*images/moron.jpg
   RewriteCond %{HTTP_REFERER} !^$
   RewriteCond %{HTTP_REFERER} !^http://(www\.)?kahunaburger\.com [NC]
   RewriteCond %{HTTP_REFERER} !^http://images\.google\. [NC]
   RewriteCond %{HTTP_REFERER} !^http://images\.search\.yahoo\. [NC]
   RewriteRule \.(jpe?g|gif)$ /images/moron.jpg [R]

Those are mod_rewrite rules that examine incoming image requests. For each request we check if the HTTP_REFERER (in what context was the image requested) is a local page. We also check if it is one of the image-search-engines that requests the file. If it is, then everything is fine. However, if the HTTP_REFERER is something else (an article on impactlab.com for example), then instead of sending the requested image, we send something else. The replacement image still consumes some bandwidth, but it is fun to watch it pop up on external sites. The RewriteRule above could also be changed to not send anything back at all. Should I ever have serious bandwidth issues I just change that.

3 Responses to “ Enough hot-linking already ”

  1. river
    September 19th, 2006 | 4:52 am

    Yah..i was browsing myspace.com and saw your image replacement. Not only was it done with absolutely NO CLASS by you, but it shows you to be a moron as well as the folks who hotlinked.
    Why not try a little class instead of the mean “moron” message? isn’t the world hard enough without you making it even worse by insulting people you don’t even know?
    How bout “used without permission”? or “image removed by kahunuaburger.com”
    the internet is not friendly anymore and as such your total disregard for the individuals who are hotlinking is as bad as them hotlinking to begin with.

  2. September 19th, 2006 | 9:28 am

    river - i contacted most of the people who hotlinked to my site. i waited for weeks and did not get a single response. at that point i decided to put a “harsh” message out there. after receiving your feedback i toned the message down.

    thanks - tobias

  3. Daniel
    September 20th, 2006 | 4:57 pm

    Dammit, I was wondering why I was seeing that moron thing!

    You know I would ask first!

Leave a reply

« « Oktoberfest starting tomorrow | Karaoke A-Go-Go » »