Apache deny access to images folder, but still able to display via <img> on site
- by jeffery_the_wind
I have an images folder on my site, let's call it /images/ where I keep a lot of images. I don't want anyone to have direct access to the images via the web, so I put a new directive in my Apache config that achieves this:
<Directory "/var/www/images/">
Options Includes
AllowOverride All
Order allow,deny
Deny from All
</Directory>
This is working, but it is blocking out ALL ACCESS, and I can't show the images anymore through my web pages. I guess this makes sense. So how do I selectively control access to these images?
Basically I only want to display certain images through certain webpages and to certain users. What is best way to do this? Do I need to save the images to the database?
Tim