Originally posted by Bloo_Fish
Just outta intrest, What would be the cleaner way of doing this? As i'm quite intrested
Thanks
Didn't really take note of it when I saw the process, since I don't have access to one. It's done in the server httpd.conf (config) file. Basically the same, but more efficient since the server doesn't have to check the .htaccess each time.
Do a google search about it, as I'm not sure how exactly you implement it myself.
(
cut-and-pasted from another forum)
<Directory "/path/to/your/images">
Options +FollowSymLinks
### Protect Local Images
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^
http://(www\.)?yourdomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [NC,F]
</Directory>
You can also prevent leeching of any other formats (also with the htaccess method), just add them in the rewrite rule (jpeg|mid|exe|zip|mp3) and so on.
------------------
Originally posted by Matthew-1985
Edit: Just set it up and went to the site with my stolen picture and it seems to be downloading 100s of KBs.
Try placing your replacement image in a different directory to the ones you are preventing leeching.