Thief! Stop hot-linking my image!

Have you ever caught someone hot-linking an image on your site? If you don’t know what hot-linking is: (from Wiki)

Hot-linking is when someone uses a link to an image that is saved on another website instead of saving a copy of the image on the website that the picture will be shown on.

Why hot-linking is bad? Because when someone is hot-linking your image, he/she is using your server’s bandwith to serve the image to their readers. So let’s say you took a picture in Paris on a holiday and you put it up on your blog (let’s say the file size is around 1 Mb). I saw the photo on your blog and then hot-link it on my own blog. That means when my readers view the photo, they actually use your server’s bandwith instead of mine to display the picture. If I have 1000 readers daily looking at the picture, that means I’ve stolen 1000 * 1 Mb of bandwith from you and you are not even aware of it.

Today I found a site that is hot-linking to an image on my post about SMSDiscount. I’m gonna tell you a good way on how to stop people from ever hot-linking to your images.

No, it’s not email-ing them and asking them to stop. You can. That would be nice. However, do you have the time once your site has grown? Or do you even bother to check your server stats, etc to find out whether any of your images are being hot-linked?

What you need to do, is to create an htaccess file and put it on the folder where you store your images. Inside this file will be a set of rules to tell your server, that none of the files inside can be accessed/loaded if they are not requested by a page on your own site. So for example, “If a website outside of www.cravingtech.com wants to load an image from my server, rejects it”. You can also be creative and redirect all images to an image of your choice, for a revenge, if you are into that kind of thing ^^

Instructions
Download the htaccess file from here, open it with your text editor and replace YOUR_DOMAIN with your domain name. On the last line, replace it with the path to the image that you want to display when someone is hot-linking your images. Or if you prefer to just block it, simply change the last line to

RewriteRule \.(gif|jpg)$ – [G]

Then, upload the file to the folder that contains your images & their respective subfolders. Rename the file to [dot]htaccess (replace “[dot]” with .)

Revenge is sweet

For example, here is a screenshot of the site that is currently hot-linking to my image:

SMSDiscount

After I applied the htaccess with image forwarding, the site now looks like:

Prevent Image Hotlinking

That should teach em’ a lesson! :D

My question is: I feel bad about the site’s author, though. Should I notify the owner? He/She probably doesn’t know that hot-linking is bad. I mean, I’ve done them before, I’m not a hypocrite. What do you think?

Comments are closed.

Share via
Copy link