Since we wrote this article, it has been "dugg" on Digg.com. If you like it, please vote for it here:
http://digg.com/linux_unix/hot_linking_fun
As you know, everybody loves cartoons -- some a bit less, some a bit more. Some love them so much, that whenever they come upon a cartoon they have to post it on another web site, forum, blog, etc... I know I should feel glad when others like my cartoons...but here's the problem:
1. Posting a cartoon on a web site WITHOUT the author's knowledge and agreement is a copyright violation.
2. If the cartoon (or other image) is hot-linked, that becomes a bandwidth theft.
I am sure many people don't know this (not everybody knows what hot-linking is, just ask my wife:-), so I will try to explain:
"Hot-linking" is a very common problem: users steal (willingly, or unwillingly) other sites' bandwidth by directly linking to images on an external website. Hot-linking could be a very serious problem when and if an image is posted on the many forums and message boards on the Web that allow users to insert images. These can't be kept on the host site, so the user hotlinks them when creating the <img /> tag. The result can be devastating to the original web site and cost many, many $.
Wickipedia defines hot-linking as:
"In-line linking, also known as hot-linking or leeching, is the placing of a linked object, often an image, from one site in a web page belonging to a second site. The second site is said to have an in-line link to the one where the object is located. It is used for such activities as linking images from personal home page storage into the online diary of the person controlling the personal home page.
There is no difference to a Web browser between a HTML reference to an image on the same site, and one on a different site. Both links would be written with the same HTML code. The ability to display content from one site within another was part of the original design of the Web's hypertext medium. The blurring of boundaries between sites, however, can lead also to other problems when it violates users' preconceived notions, as in the case of cross site scripting.
This has sometimes been controversial because it is possible that the site where the object is stored and from which it is retrieved will not like the new placement or will consider it to be bandwidth theft. This term refers to the unauthorized use of someone else's bandwidth. In-line linking to an image stored on another site increases the bandwidth use of that site, even though their site is not being viewed in its intended form. Since bandwidth is a commodity, unauthorized use can increase the maintenance costs of the website hosting the image, hence the term bandwidth theft.
Some other forms of hot-linking also include video files, music (or mp3) files, animations (such as flash), and just about every other form of media."
Hot-linking has been a real problem with eToon.com lately. We noticed an increased traffic, especially from MySpace.com. At first we came with the idea of serving alternate image when hot linking is detected. For example:

Can become:

You can set up your .htaccess file to actually serve up different content when hot-linking occurs. This is more commonly done with images, such as serving up an Some Dude image in place of the hot linked one. The code for this is:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?etoon.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ somedude.gif [R,L]
Same deal - replace etoon.com with your own domain, plus somedude.gif.
But since traffic has gone through the roof, we have completely disabled hot-linking on etoon.com. You can always do it too, but it is not so much fun ;-) Here's how:
Add the following lines in your .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?etoon\.com [NC]
RewriteRule \.(gif|jpe?g|png)$ - [F,NC,L]
and presto! Your images on other sites are blocked!
Posted in etoon's blog | login or register to post comments
Submitted by etoon on Wed, 2006-06-07 17:55.


