Avoid image Hotlinking

Documentation > Manuals > Avoid image Hotlinking

Hotlinking

When you upload an image to your Chevereto, this 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 for their own images. This can be very destructive if they are abused and this means a bonus for you.

We come to your aid

Fortunately, it is possible to prevent these unwanted guests. With simple .htaccess rules you can prevent the theft of bandwidth and determinate which sites can benefit from your image hosting. What we do is establish a list of sites that can freely insert your images and those who can not.

Allow just to some sites the access to your images

Aadd anywhere 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 allow to use the thumb to link the images to show but not directly.

Now, if you want to deny complete 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 demonstration of the image error, you can see 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 of admitted, because the rule would go into a loop and you hang yourself.