PDA

View Full Version : Anti-Leeching of image files


GateKeeper
2-15-03, 01:20 AM
Greetings:

I have been studying the scripts used to prevent other websites from directly linking to the images on my website for use on theirs.

I have tried to use this one:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://yousite.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yousite.com/ [NC]
RewriteRule [^/]+.(gif|jpg)$ - [F]

However, when I do NO images appear on my website at all.

I replaced "yousite" with mine [chinook-helicopter], uploaded the htaccess.txt file in ASCII, and renamed it to .htaccess once uploaded.

I have even tried it with the first line deleted. In this case, the images appear on the website, but I am still able to leach the images from my home computer when I run a webpage with the image tag pointing to chinook-helicopter.com as the source.

Any Suggestions, or perhaps a different routine?

Mark

sandy
2-15-03, 03:17 PM
Try this.. it works, and make sure that you have wordwrap off.. I find that wordwrap on sometimes causes problems:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite\.com.* [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule \.(gif|jpg)$ http://www.yoursite.com/rejected.GIF [R,L]

Good luck,

Sandy