What is Hotlinking and how to disable or prevent Hotlinking to save your bandwidth

Add a comment

What is Hotlinking and how to disable or prevent Hotlinking to save your bandwidth

What is Hotlinking?


You use many images and videos in your website. And normally such images and videos are of large size. If anyone else directly uses your images or videos in his website then it is called Hotlinking. Hotlinking is also called Inline linking, leeching, piggy-backing and direct linking.

Hotlinking of your images by other websites has many adverse effects on you; most of us use shared hosting and limited bandwidth is provided to us by our hosting company.
What Hotlinking of your images by other sites does is it eats up your bandwidth and you loose your precious bandwidth.

How to prevent from Hotlinking of your images, videos and other files to prevent your bandwidth?

As now as you have known about Hotlinking and its effect you will surely want to prevent from it so that no one else then you will be able to use your images.

Below is mentioned a way to prevent Hotlinking of your files or images by other sites using .htaccess.

You need to edit a file in your web server named “.htaccess” which is located in your web host root or home directory. You can use filezila or any other ftp program to edit that.

You need to place a code in your “.htaccess” file below is the way to get your code.
Place the code anywhere inside your “.htaccess” file but don’t delete or edit the existing code there just place the code you get at the bottom part of the file.

To get your .htaccess code:

First of all go to this website:

www.htaccesstools.com/hotlink-protection/

A webpage looking similar to following image will appear.
 Prevent Hotlinking of Images and files.

Now fill the form as described below:

1> in this filed write your websites or domains which you want to allow to hotlink or show the images. You need to write all of your websites in the form “yoursite.com” here one per line, other wise the code will prevent your websites also from showing the images.
2> Choose “yes allow blank referrers” here if you choose “no block blank referrers” here then your images could not be seen even if it is directly fetched by peoples.
3> You can leave this field blank. If you type link to some image here then the image you types will be seen instead of original image if someone Hotlinked it.
It will be easier to leave this field blank, but if you choose to show some image then don’t show image from your website or server in which you will or you have blocked Hotlinking it may cause problems.
4>Type the extension of images and files you want to block separated by a space all
Other files except of the extension specified here will be allowed to Hotlink.

You can type “jpg jpeg png gif JPG JPEG PNG GIF” in this filed to block images from getting Hotlinked.

After you fill out the form click on generate then a code will be shown to you.
Now copy the code to your .htaccess file as mentioned above.

  • Share/Bookmark


Please don't forget to leave your ideas , feedback and question using the comment form below:
  1. | #1

    Nice blog i think you’ll be interested in my site.

  2. | #2

    @m310
    Thanks for your comment.

  1. No trackbacks yet.
Comments feed