Solution to hotlinking

Is there a real solution for hotlinking? If anyone knows the solution, please share with us all. Why I say “real” solution? Because there are some solutions which partially solve the problem of hotlinking but at the same time it causes other problems. But before we proceed further:

What is hotlinking

Hotlinking is a process of linking directly to someone else image/pictures (on their server), thus consuming their bandwidth. If you are the victim, it’s impact is minimal on your bandwidth if there is only few hotlinkinks to your images, however if there are hundreds of hotlinks then you will see that your bandwidth is being eaten by other websites.

Another problem is, sometimes you do not want others to display your images on their blog without your consent. So, in this case, hotlinking equals to stealing.

How do you stop Hotlinking?

There is a way to stop hotlinking through .htaccess. Htaccess code for blocking hotlinkers will look something like this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?adesblog.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|ico|js)$ /images/nohotlink.png [NC,R,L]

Why the above code doesn’t solve the problem? It does, but it also blocks all the other legitimate readers of your blog from viewing your images. Since RSS readers (like google reader) aggregate your posts into their interface, the above htaccess code will think RSS readers are hotlinkers too, therefore they all will be blocked from displaying your images.

So, if you put the above code, then your readers will be reading only texts of your posts. As for the images, they will be replaced by one image that you specify, in the above case it’s “nohotlink.png“. So all the images of your blog will be replaced by “nohotlink.png” in the RSS readers. That’s not good. So, the ultimate question:

How to solve this problem of hotlinking? While blocking all hotlinkers and allowing all RSS readers?

If you know the answer / have the solution for this problem, do enlighten us! We all will be grateful.

Link (for generating htaccess code for hotlink protection):
http://www.htaccesstools.com/hotlink-protection/



17 Comments on "Solution to hotlinking"

  1. kuanhoong says:

    Yes, I too faced the same problem with my images in the RSS reader. I am wondering whether there is a better solution to this.

  2. jialat says:

    I am using this “hotlink protection” plugin, works well for me, it is from http://www.bahn-spass.de/2007/05/05/hotlink-protection/.
    also, I heard that for some cpanel, we can actually set it to stop hotlinking, but I never try it before.

  3. First of all, is there anyway to know if someone is hotlinking to your images in the first place?

  4. Cow says:

    I suppose one way of doing it (though complex) would be to use a WordPress plugin to modify the URL of images (e.g. add something like ?from=rss onto all the image URLs) and don’t block requests with that string at the end. Of course, it doesn’t stop someone from hotlinking your images by including that string when they hotlink but 99% of people probably won’t work that out and the rest have to explicitly circumventing your hotlink prevention which many people will probably have moral objections to.

  5. BlogSavvy says:

    Great post, again useful infomaation i’ve bookmarked you and will check back often.

  6. PS3 says:

    Depending on the hosting package you use, the first you will probably know is when you get a friendly warning from your host about exceeding bandwidth…or at worse, they suspend the hosting for going over your allowance.

  7. Putera Emas says:

    I can’t stop hotlinking, but I can save your bandwidth usage. Upload all your images to imageshack.us. Problem solved!

  8. Ps3 Gamer says:

    Nice one! Hot linkers had slowed down my website due to bandwidth restrictions. Not any more thank you!

  9. Ades says:

    Thanks jialat for the plugin, i will check that out.

  10. I have yet to encounter this problem, but in the case that I do… I am going to bookmark this page. Hopefully somebody comes up with a solution.

  11. Eliza J. says:

    While researching for the solution, I get to know about this article http://htmlcenter.com/blog/hotlink-protection-with-php/ but I’m not sure if it helps as I’ve not tested it.

    It was based on preventing hotlinking problem with this script –

    Let me know if it helps.

  12. Yet another great post, one issue I often face is that I have made a couple custom graphics for affiliate programs that I am helping to promote which others feel that they can steal. I intend to simply change my image to something obscene every month of so while changing all my own references to the regular image, problem solved ;)

    -Jim

  13. AlexL says:

    hi! I’m beginner for blogging

    how “hotlinking” look like?
    i’m confuse here…

    any one can help me?

  14. Ades says:

    Alex, you can’t differentiate hotlinks unless you look into the source code of the page. But I am sure you would recognize your images if someone else has posted on their blog without your consent. If they do that, if the source of the image still points to your server, then they are hotlinking.

  15. Blog Hacker says:

    I have faced this problem. Uploading them to imageshack might solve it, but i suggest in reducing the file size by converting to JPG.

Trackbacks for this post

  1. Some Link Love | Sha Money Maker
  2. Websites tagged "hotlinking" on Postsaver

Got something to say? Go for it!