Forum Moderators: phranque

Message Too Old, No Replies

htacess file to protect image theft

Is this format correct?

         

coosblues

5:51 am on Mar 9, 2007 (gmt 0)

10+ Year Member



I know nothing about the .htaccess file, but I found a site which generated the following code for me: I only want to allow Google access so my images will continue to be picked on on Google images. Is this code correct, and do I place the file where my images are stored?

RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?mysite.com [NC]
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg¦jpeg¦png¦gif)$ - [NC,F,L]

Thank You

phranque

6:41 am on Mar 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



looks pretty good.
there is a good thread on preventing image leeches [webmasterworld.com] in the Apache Web Server library [webmasterworld.com].
you might make a couple of tweaks or have a specific question after reading this.

jdMorgan

3:59 pm on Mar 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can replace "jpg¦jpeg" in your RewriteRule pattern with the equivalent "jpe?g" to save a bit of CPU time...

Jim

coosblues

4:29 pm on Mar 9, 2007 (gmt 0)

10+ Year Member



Thank you all for your answers. Much appreciated!