Hi all,
i know there's tons of posts about this but i've tried most of them and somehow i cant get it to work properly so i'm asking the experts some help :)
I have this image folder, inside it i have a few subfolders and inside those subfolders some pictures that i want to be only accessible from within my website. Meaning that using the direct link www.example.com/images/abc/nwoienfwewf.jpg should return a forbidden page, while if requested by the site itself should show fine.
inside the images folder i've added a .htaccess file with this:
Order deny,allow
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?my-website.com/.*$ [NC]
RewriteRule \.(gif|jpg|png|mp3|mpg|avi|mov|flv)$ - [F]
but this prevents the images from showing up on the website and with direct access i get "Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request."
now i've tried a few variations of what i could find and even tried a generator but no success.. The best i managed was to get forbidden on direct access but files we also not loading inside the website.
note that in the example i've used "my-website" just to show that my domain contains a dash "-" (not sure if that has any influence there).
Anyway i hope this all makes a bit more sense for you that it does for me :)
thanks!