Disable Hotlinking of images & Save bandwidth

ADVERTISEMENTS

For starters, hotlinking means: In case, I have uploaded an image on my server www.tothepc.com/image.jpg Some other person without permission, copy this link and post at some other website or blog. Now, image is stored on tothpc server, while it is being show on some other website.

This is called hotlinking, it is very common on images posted on forums. This can cause big time lose in increased bandwidth consumption. However, you can check this by disabling hotlinking on your site.

In case your hosting provider does not provide disable hotlinking feature, no need to fret. You can easily do that, bywriting few simple lines of code. Now the best part, you don’t even have to write that code, because HTACCESS Banning Generator can do that for you.

Using this online tool, you can easily disable hotlinking, ban an IP and even ban a referral domain.

Coming to disabling of hotkinking, you need to perform following steps:

  1. Open this weblink for HTACCESS Banning Generator.
  2. Enter the list of domain where hotlinking is allowed (where images should appear). I entered tothepc.com
  3. Then enter the type of files that should be disabled from hotlinking. (eg: gif ,jpg, jpeg)
  4. Then click on generate code.

Here is the code, when I entered tothepc.com for allowed domains and file types selected: gif, jpeg.

What to do with this code?Well, the ending process is also easy. You need to open .htaccess file located under root folder. Open this file in notepad and append/add the above lines under the existing code.

Caution: Before you make any changes, make sure you backup the .htaccess file, you can simply copy the copy in a notepad file on your computer. Also, do not delete any existing line in the file, if you do not know what it is all about.

After adding the above code, save the link and hotlinking will be disabled. You can generate code for .htaccess file for various other features as well.

User IP ban: Enter IP address that needs to be banned.
Site Referrer Ban: Enter the URL of referring site that needs to be banned.

I found this utility very handy as compared to my constant googling to get that perfect code for hotlinking or banning. Hope it will be helpful to you as well.

SHARE
 

Comments

  1. You will also find that you may bave problems if your site delivers marketing emails that use HTML and directly link to the images to your site users. Unless you create rules to handle every possible type of webmail/email client you will be delivering broken images to your subscribing memebers.

Add a Comment

*