I’m scratching my head over an htaccess hotlink protection conundrum. I’ve tried code snippets from three websites (see examples below) and each of them fails when I test it. Are all three variations wrong? If not, can you provide some pointers that might help me to work out what I’m doing wrong.
Um, right. Don’t really understand your feedback inside the quote, or your last sentence, so I can’t answer that. But I can confirm with reasonable confidence that mod rewrite must be working because other functions that use it seem to be OK.
The problem MAY be with using all three code snippets at once (presumably, you’re smart enough not to have done that but others may not see it that way and try it).
From the tutorial linked in my signature, I’d recommend ONE of the sample codes for you to use as a test:
Obviously, replace example.com with your own domain name and add “hotlinked.gif” in your DocumentRoot - that’s just any image that you will recognize as being redirected from this code.
Then, from a new window or tab, attempt to link to an existing image BY TYPING THE LINK DIRECTLY (i.e., no {HTTP_REFERER}), i.e., http://www.example.com/images/logo.gif and see whether you get redirected to the hotlinked.gif image or not. If not, you have a problem with your mod_rewrite (no RewriteEngine on statement, not enabled, .htaccess not enabled, something other than the code).