2

I may have asked this in the wrong site -- so I am trying my question here.

Like to deny access to all files within a directory; while allowing access to files within the sub directories. I thought I had this licked until I notice a denied access error under apache logs for one sub directory.

/www/domain.com/public_html/directory

In this folder deny access to all files



/www/domain.com/public_html/directory/subdirectories

In the sub directories allow full access to all files which include jpeg, jpg and index.php files



The sub directories are dynamic albums and contain only jpg images and an index.php file for processing and nothing else.



Here is what I am using that seemed good to go until I seen an permission denied error on one of the images with the subs. Which is there and should have full access.

<Directory "/www/domain.com/public_html/directory">
   AllowOverride None
   Order Deny,Allow
   Deny from All
   <FilesMatch ".jpg|.jpeg|index.php">
       Order allow,deny
       Allow from all
   </FilesMatch>
   ErrorDocument 403 /
   ErrorDocument 404 /
</Directory>
<DirectoryMatch "/www/domain.com/public_html/directory/[A-Za-z0-9]{6}">
   Order Deny,Allow
   Allow from All
   ErrorDocument 403 /404.html
   ErrorDocument 404 /404.html
</DirectoryMatch>

0 Answers0