Prevent Image Hotlinking

Add The Following code to a .htaccess file in your home folder.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ – [F,NC]

In the example above be sure to replace domain.com with your actual domain name.   This will stop other sites from hotlinking images that end in .gif, .jpg, .jpeg, and .bmp.

Leave a Reply

You must be logged in to post a comment.