Chat with us, powered by LiveChat

Prevent Image Hotlinking

Put this piece of code in your .httaccess file on the Apache web server and it will automatically block all image requests coming from specified domains.

The website requesting the image resource will be returned a 403 Forbidden error.

 RewriteEngine On
 RewriteCond %{HTTP_REFERER} ^http://(www\.)?example\.ru(/.*)*$ [NC,OR]
 RewriteCond %{HTTP_REFERER} ^http://(www\.)?example\.cn(/.*)*$ [NC,OR]
 RewriteCond %{HTTP_REFERER} ^http://(www\.)?leecher\.com(/.*)*$ [NC]
 RewriteRule \.(jpeg|JPEG|jpe|JPE|jpg|JPG|gif|GIF|png|PNG)$ - [F]