Community Discussion

How do you prevent hotlinking to images?

May 23, 2013
Beverly Author Level X3

Write the reason you're deleting this FAQ

Sometime back, I noticed an intense amount of bandwidth for one particular site and found out that one of my images was being hotlinked to. I changed the image name so it could not be hotlinked to anymore. And, enabled no right clicking on the page. Now I host images on other sites like tiny pic. Since then I haven't noticed a problem. Are there any other ways to prevent hotlinking to images?
16

Comments 16

June 1, 2013
kyabaat
What do you mean by hotlinking an image ? Do you mean images which are pointing to other sites ? If yes, then you can always trim url or a href tag whenever user tries to post it How do you prevent hotlinking to images?

Enter a reason for deleting this comment

June 3, 2013
Tommy Matalino
I know there's a plug-in that can prevent this.
For example, if someone hotlink your images, a default image would show up, saying "NO HOTLINKING" or something like that. Or images won't load on other pages aside from yours.

Enter a reason for deleting this comment

June 4, 2013
June 6, 2013
Tommy Matalino
I love that idea! Thank you so much. Do you know if this plug in is available for Blogger or just Wordpress? I'm mostly into Blogger now. Though I also have a forum. I'll have to check to see if SMF has a similar plug in for their software. Thanks for this suggestion.

I don't think it's available to Blogger as it is using Google's servers to host images. You won't get any problem on lost bandwidth.

Enter a reason for deleting this comment

June 11, 2013
Jolie
There are many scripts available that can prevent others from right clicking the page and that will prevent them from taking your images.

Enter a reason for deleting this comment

June 16, 2013
kyabaat
For instance, let's say you are hosting images on your own server space (uploaded images) and others are using the jpg code to hotlink to them, rather than downloading the images and uploading to tinypic or other free hosting space. This can get very costly especially if you are being charged for bandwidth overage.


okay. I guess to prevent overusage of bandwidth sites like imageshack and tinypic limit number of times a image or account can show it simultaneously.

Enter a reason for deleting this comment

echizen
If you're on self-hosted website running under Apache web server, you can edit your .htaccess file and add the code below to your .htaccess file (if using Wordpress, place after default Wordpress .htaccess code)

RewriteEngine on
# Allow blank referer
RewriteCond %{HTTP_REFERER} !^$
# Sites allowed to link your images. Add your other site here
RewriteCond %{HTTP_REFERER} !^http://(www\.)yourdomain.com/.*$ [NC]
# custom blocking images.
RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ - [F]

to server alternate image (e.g. an image with special message/text), add this code and placed after above code
RewriteRule \.(gif|jpg)$ http://www.yourdomain.com/angryman.gif [R,L]


replace yourdomain.com with your domain name. replace angryman.gif with your alternate image name.

if you have any suggestion or improvement, let me know.

Enter a reason for deleting this comment

June 21, 2013
kyabaat
Can you please tell us what is the language in which you have shared the code ?

Enter a reason for deleting this comment

Tommy Matalino
There are many scripts available that can prevent others from right clicking the page and that will prevent them from taking your images.

There's still a way. Printscreen plus photoshop. Another way is the use of "Page Info" (Mozilla: Tools > Page Info > Media).

Enter a reason for deleting this comment

kyabaat
To addon you can use snipping tool ;)

Enter a reason for deleting this comment

Tommy Matalino
To addon you can use snipping tool ;)

How do these snipping tools work?

Enter a reason for deleting this comment

June 27, 2013
June 28, 2013
kyabaat
How do these snipping tools work?


open snipping tool, and click on new. Once you click on it, you can select area to take screenshot and then save it.

Enter a reason for deleting this comment

June 30, 2013
July 12, 2013
kyabaat
I can't find this tool on my XP OS. But I remember the snipping tool being on my Vista. I use puu.sh now, they have a nice snipper tool. There are many others, I'm sure.


oh oh.. My bad. I should have asked you about your OS. As you said, you are using XP you can use screen recorder or use snipping tool for xp, which you can download from http://xpsnipping.codeplex.com/ How do you prevent hotlinking to images?

Enter a reason for deleting this comment

Please login or sign up to leave a commentJoin