Techniques for Fighting Image Theft
Code May 17, 2008
If you are not willing to have others ride piggyback on your bandwidth and steal your graphics directly from your plate, you can fight this image theft by redirecting links from external sites to your own “don’t steal” graphic.
You will need to have an .htaccess file in yours site root folder. Add the following lines to this file:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?your-website\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png|jpg)$ /images/your-dont-steal-graphic.jpe [L]
Replace your-website.com and your-dont-steal-graphic with your own information.
Thinking there is a typo and that the file ending should not be jpe but jpg? Not in this case. Using jpe as file ending will block regular images to be shown on third party websites but the first part of this line is an exception to the rule which will allow your custom “don’t steal” graphic to be shown.
Thanks to David Airey who wrote a more in-depth article on this.