Disallow everything in directory except subdirectories with certain name using .htaccess or vhost.conf

Posted by Jizbo Jonez on Server Fault See other posts from Server Fault or by Jizbo Jonez
Published on 2012-11-24T15:45:47Z Indexed on 2012/11/24 17:05 UTC
Read the original article Hit count: 343

Filed under:
|
|
|

How can I disallow everything in a directory except any subdirectories that have a certain name using htaccess or even vhost.conf for the site? I have a protected main directory which contains subdirectories. Each of the subdirectories have another child dir named 'thumbs', that I want to allow people access to. In the thumbs folder I have files which all start with 'thumb_' prefix for the filename. So which approach to use, .htaccess FilesMatch or vhost DirectoryMatch? and what would be the code to use? Thanks

© Server Fault or respective owner

Related posts about apache2

Related posts about .htaccess