Stop Sites From Hot-Linking To Your Images

Here's a quick tip. While checking my stats to see if the FunWebProducts bot was still being blocked, I noticed that there were a huge number of hits for one of my images. I had previously noticed that a website was hot-linking to another small image months ago.

At that time, I figured it didn't hurt because the image was just about 1KB in size, so I did nothing. However, this kayu website (a very big website with thousands of Malaysian users) started hotlinking to multiple images and was beginning to eat up my bandwidth. So I decided to block all hot-linking.

It's pretty easy to block people from hot-linking to your images. Just add the following code to your .htaccess file :

# Stop HotLinking
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?positivemoneyideas.com/.*$ [NC]
RewriteRule \.(gif|jpg|js|css)$ - [F]

This should effectively block all those dartardly evil doers who don't have the decency to create their own images but instead choose to steal not only the image, but to eat up my bandwidth while stealing!

Share this blog post with a friend:

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Technorati
  • Netscape
  • Reddit
  • YahooMyWeb
  • StumbleUpon
  • Linkter
  • SphereIt
Printed from: http://www.homewithandrew.com/index.php/stop-sites-from-hot-linking-to-your-images/ .
© HomeWithAndrew.com 2010.

3 Comments   »

  • Mike says:

    Awww you're way too nice, Andrew!

    When someone starts doing that repeatedly and taking up your bandwidth.. you should point all your data to a new copy of the file, then replace the old one with something inappropriate or amusing. :mrgreen: I've seen/used everything from a massive in area but small in disk space graphic that said "THIS WEBSITE TRIED TO STEAL MY BANDWIDTH" to some.. well.. stuff you shouldn't see :)

  • Andrew says:

    Hi mike. Thought about that. I found out that this is a scammer site with a very bad reputation and known to be administered by bad hats, so I am taking a long winded, but non-aggressive approach. I've re-designed the hotlinked image. It's now a white 1x1 pixel that's about 100 bytes. After about a month, I will delete the file.

  • Alexwebmaster says:

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

RSS feed for comments on this post , TrackBack URI

Leave a Reply

  • Recent Comments

    • Jefferey Winslow: Thank you.
    • Nakisha Butsch: Hi i love your blog, found it while randomly surving a couple days ago, will keep checking up. Btw...
    • musti009: hahaha! i made 500 today m veryyy happpy!!!!!!!!!!!!!!!!!!!!!!!! ! :mrgreen: :mrgreen: :mrgreen: :mrgreen:
    • Lee Matute: Sick of obtaining low amounts of useless traffic to your website? Well i want to inform you of a fresh...
    • firearms: I located your blog online and read some of your other blogposts. I just now included you to my Google News...
    •  Foot detox: my brother was one of those people that contracted H1N1, luckily, he survived...