Last updated on November 17th, 2015 at 06:38 am

Protect your website bandwidth from other websites that tries to hotlink your images. Htaccess hotlink protection is the right way to do it.
Very simple you can prevent this using a .htaccess file in your images directory and add the following code


RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yoursitename\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ nohotlink.jpg [L]

Once the htaccess file is saved put it under your WWW directory or to any other location which needs all your images to be protected.

Simple 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *