Ways to Stop Image HotLinking & Bandwidth Theft

Image HotlinkingHotlinking is a way in which someone would directly link to your website hosted Image & Video Files because of which the you need to pay high bandwidth bills. This is the very reason its really important to make sure that you can stop hot-linking and make sure that other website owners don’t steal your bandwidth. You can easily detect this stuff when you use tools like tynt or when you check out your website’s statistics log through Awstats. Normally when you add a Image in your website or blog, it would be added in the following way.

<img src="imagename.jpg" height="500" width="300">

But when the Image is Hot Linked by someone else, then the code would be changed and when you view on the source code you will find it as below listed.

<img src="http://www.amitbhawani.com/imagename.jpg" height="500" width="300">

You can easily point out the difference, which means that the bandwidth stealer is going to directly put your website image URL for showing the Image on his website. Hence, whenever his website is accessed and loaded, your website Image is loaded, hence increasing your Broadband Bills. Few regularly seen situations where we find out Images Stole are on Auction Websites like ebay, Classified Websites and Webmaster Forums in most cases of these the content is posted by guests and visitors. This is something which everyone should avoid and if they are not interested in hosting the Images on their server, then its recommended that they should be using different free Image Hosting services.

Next we need to find out different ways which can stop our Images from being HotLinked. Here are few of them :

The stealer’s would normally right click on the Image and Copy Image Location and then Embed the same on their websites. This is one of most easiest way of copying someones Image and using them. In order to stop people from opting this way, its recommended to Disable Right Click option on your Blogs or websites using plugins or Javascripts. This can not only Disable Right Function but would also make sure that others cannot copy your content too.

Using .htaccess to Stop HotLinking & Bandwidth Theft : Next way would be by Implementing .htaccess Tricks which would show some other Image on the Target Website whenever they would HotLink your Images. This can be easily done and using some Pranks or Funny Messages on the Images you can even build in some Backlinks to your website when others would find this out.

If my site url is www.amitbhawani.com and i want to make sure that someone is not able to steal my Images i would have to create a new Image name which would be dislayed on the stealers website. Hence if the Original Image is myimagename.jpe, you can name the to be shown Image as funnyimage.jpe and then add the following code in your .htaccess file which is normally located on your website’s or blog’s root folder.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(. \.)?amitbhawani\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /funnyimage.jpe [L]

The first line of the code would start with the rewrite function and the second line would define your own domain name which can be considered under the While List. Next is the going to allow empty referrals, following which is the line which would show the Image as a replacement of the original file. In case you dont want to show any replacement Image and just show a error to save 100% of your bandwidth, then its recommended to show a 403 Forbidden error by using the following code in your .htaccess file.

RewriteRule .*\.(jpe?g|gif|bmp|png)$ – [F]

That’s it the above listed process can make sure that you can show a Replacement Image instead of the Original Images when someone steals them and uses them on their websites. Let us know if you find any issues in implementing this. Following is one interesting way of stopping Image HotLinking where in the Original Image owner edited and added some funny text to the Image as shown below. [Source]

Steal Image Hotlinking

Steal Image Hotlinking

We will send you useful technology related Tips. Enter your email address :

About Amit Bhawani

My name is Amit Bhawani and I am the chief blogger at Amit Bhawani Blog and where I like to share my internet/tech experience with my online readers on this website. You can read more about me at my About Page. You can follow me on Twitter, Facebook & Google +1 at +Amit Bhawani

Comments

  1. Pavan Somu says:

    Nice tutorial bro. This trick will be most helpful for professional bloggers like you. Thanks for sharing.

  2. This is certainly very effective in stopping other websites from hotlinking and using your bandwidth. The only problem is when your images are hosted on a CDN. The htaccess does not seem to work in this case.

  3. Harsh Agrawal says:

    Nice Post Amit but I still have a doubt on this : This may stop showing your images in feeds and email readers. I guess we need to add a condition for it..

  4. Tamahome Jenkins says:

    To be honest, I don’t really mind this practice. I don’t do it myself because I like to be able to control image settings, but if someone borrows my image it doesn’t bother me. Then again, I haven’t had any issues because of it. I suppose I would change my mind should my site start to suffer because of hotlinking.

Speak Your Mind

*

More in Ultimate Guides (41 of 58 articles)