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] | |
|
Comments (0)