How to prevent deeplinking images from your website

Other sites deeplinking images from your account can cost you a fortune on bandwidth. If you see in your stats that some pictures are being deeplinked then do something about it! This is what you could do:

add the following lines to your .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^(http://|https://)(www.)?(site.com).*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ – [F]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.