Forum Moderators: phranque
Now the trouble is... I can't seems to make it work.... I have read just about everything there is on the subject... but they omit to tell you how to load and where to load.. both the .htaccess code and the refer image.
Please can someone shed some light on this issue...
If I drop my .htaccess code in my images directory... where do I drop my image url... as the image does show in the browser
but alas it doesn't work to stop hotlinking to images on my site.
Help, please .... thanks
[edited by: jdMorgan at 6:07 am (utc) on Jan. 8, 2006]
[edit reason] No URLs, please. See Terms of Service. [/edit]
You can put the code in your top-level-Web-accessible directory, or in any directory that is below that in the path to the image-storage directory, or in the image storage directory itself. Remember that the URL 'seen' by RewriteRule is 'localized' to the directory where that rule runs, though.
I don't I understand your question about 'dropping the image URL' at all , though. "Dropping a URL" is why your first post in this thread got edited -- that's the only meaning I'm aware of... ;)
Maybe you're asking this...
Your replacement image should be outside of the protected directory, unless your code has an exclusion that allows it to be shown to hotlinkers. Either method is fine and will work.
Jim
RewriteEngine On
RewriteCond %{HTTP_REFERER}!^http://(www\.)?yoursite\.com [NC]
RewriteCond %{HTTP_REFERER}!^$
RewriteRule \.(gif¦GIF¦jpg¦JPG)$ /replaced-image-leeching-image.png [L]