I have a directory on my server which contains PHP and image files.
I would like to be able to deny access to everything but the image files, the user should see a 403 if they try to access anything other then an image.
They should also not be able to see the index of page.
I have attached my sample code below it correctly denies access to documents but doesn't allow me to access the images.
The rule needs to apply to all documents folder, they could be located directly under the root or in subdirectories.
You can not deny access for a folder but then have access to a file in the folder. Instead of setting "deny" for the folder just remove the browse right from the folder.
0
nick_2007Author Commented:
Could you show the conf settings I would need for this?
# httpd.conf# match documents/ except .jpg or .png etc. at the end<Directory ~ "documents/.*+(?<!\.jpg|\.png|\.gif)$">Order allow,denyDeny from all</Directory>
Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.