Knowledgebase: Miva Merchant FAQ
Stop people from stealing your images!
Posted by - NA - on 21 February 2007 09:07 PM

=========================
Stop people from stealing your images!
=========================



Edit the following by replacing "mydomain.com", or just "mydomain" as appropriate, with your actual domain name. After that, place the text in a file named .htaccess (note the leading dot) and put this .htaccess file in a directory that you want to block the image theft from.

Requests for images from that directory or anything below it will get blocked if the request didn't start from one of your own web pages. NOTE: You will need slightly different rules if you use a shared Hostasaurus SSL certificate on your site; those rules are at the bottom.



RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^(http|https)://(www.)?mydomain.com.*$ [NC]
RewriteRule .(gif|jpg)$ - [F]



If that is not enough, here is how you can serve up a different image of your choice instead of the one they tried to link to:



RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^(http|https)://(www.)?mydomain.com.*$ [NC]
RewriteRule .(gif|jpg)$ http://www.mydomain.com/badimage.gif [R,L]



Block Image Theft:



RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://mydomain.hostasaurus.com.*$ [NC]
RewriteRule .(gif|jpg)$ - [F]



Block Theft & Return Your Own Image:



RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://mydomain.hostasaurus.com.*$ [NC]
RewriteRule .(gif|jpg)$ http://www.mydomain.com/badimage.gif [R,L]


(520 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako support.miva.com/supportsuite/index.php?