I have many image directories within a Pictures directory and would like to block direct access to them.
But - I'd also like them to be visible through a flash based gallery that I've installed. If I block access to the image completely the gallery doesn't seem to be able to display them.
The setup that I have at the minute is a rewrite from subdirectories that goes to a php script that updates some xml about about what images are in that subdirectory, then forwards onto gallery.php?album={album_name}. I'd like it if the images were only visible through gallery.php.
The .htaccess file that I'm trying currently looks like this:
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+)/$ http://mysite.com/buildgallery.php?album=$1 [L]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !gallery [NC]
RewriteRule \.(gif|jpg|jpeg|png)$ http://mysite.com/no_access.jpg [NC,L]
And the gallery redirect, generation and picture display is working. BUT - the images are still visible through direct access. I thought the second rule would prevent this?
Thanks for any help.
Tom