Avoid image Hotlinking

Documentation > Manuals > Avoid image Hotlinking

Hotlinking

When you upload an image to your Chevereto, this image can be shared. Which is very good and it is precisely the purpose of this script. Unfortunately, there are many sites that take advantage of this and can use your hosting as a store hosting for their own images. This can be very destructive if they abuse of your service.

We come to your aid!

It's possible to prevent these unwanted guests with simple .htaccess rules you can prevent the bandwidth theft and set which sites can use from your image hosting. What we do is establish a list of sites that can freely insert your images and those who can't.

Allow just to some sites to your images

Add in the .htaccess file the following:

This code allows access to the domains listed, follow the same pattern for those who want to establish your own. Note that denies access to the images in "images", in other words, we just allow to use of the thumb to link the images.

Now, if you want to complete deny access to all your images, including the thumbs, you must change the last part of the code to make it something like this:

The "error" image

We include a demo of the image error, you can see it in site-img/error.gif. This image may be anything you want, all you have to remember is that in the code above you should put the url of the image to show. Note that you must include your own domain name in the list, because the rule would go into a loop and you will be hanging yourself.