I'm currently working on a project using php, apache server and symfony. What Im trying to achieve is to prevent my images accessed via http://localhost:8000/img/logoSmall.png directly in the URL bar. I already tried Iusing the Option All -Indexes
but it does not work, I don't know if I'm doing something wrong, also I tried some things from this post like:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost.*$ [NC]
RewriteRule \.(gif|jpg|png)$ - [F]
and changing
Options Includes Indexes FollowSymLinks MultiViews
to
Options Includes FollowSymLinks MultiViews
I'm also sure that my httpd.conf file has AllowOverride All
I really don't know what else to do. I've been stuck in this for too long, If you see any errors in my solutions, or you have any suggestions I would veyr much appreciete them. Thanks in advance.
EDIT
I do want to continue displaying the images in my site, what I don't want is allow other users access them with the direct URL.