A hotlinking example:
theif.ext wants to add some pictures
to his website. theif.ext predicts
that thousands of people will view
these pictures every day. theif.ext
knows he does not have enough
bandwidth to host these pictures
from his own site.
theif.ext finds another website
that has the same picture files, say
victim.ext. theif.ext hotlinks the
pictures from victim.ext's website
by adding the following html code to
his gallery.html page.
theif.ext is now hotlinking
pictures from victim.ext's website.
Even though the pictures show up
when going to theif.ext/gallery.html,
the data that is being transferred
to your web browser is coming from
It is not uncommon for the victim
to run out of bandwidth due to
What can be done to prevent
To stop hotlinking you can use a
web host that provides an easy
to use interface to mange hotlinking
If your host does not have such
an interface, you may stop
hotlinking of your images from other
sites by using a .htaccess file. The
following code will cause an image
called nohotlinking.gif2 to be
displayed instead of your images.
first line of the above code
begins the rewrite.
second line matches any requests
from your-site.com url.
code means "No Case".
third line means allow empty
line matches any files ending with
the extension jpeg, jpg, gif, bmp,
or png. This is then replaced by
the nohotlinking.gif2 file in your
images directory. This gif image
is using the extension .gif2
instead of .gif to prevent
blocking of your own replacement
To stop hotlinking only from
specific domains such as myspace.com,
blogspot.com, and livejournal.com,
place this code in your .htaccess
If you are worried bout your
nohotlinking.gif2 image using up all
of your bandwidth, you can display a
403 Forbidden error code
instead of an image. Replace the
last line with the following:
.*\.(jpe?g|gif|bmp|png)$ - [F]