Apache: deny acces to directory but allow 1 file
5,820
Files tag must use relative path to Directory. With absolute path (<Files /var/www/abc/README.txt>
) it doesn't work.
This works:
<Directory /var/www/abc/*>
Order allow,deny
deny from all
<Files README.txt>
order allow,deny
allow from all
</Files>
</Directory>
Related videos on Youtube
Author by
martin
Updated on September 18, 2022Comments
-
martin over 1 year
I am using Apache 2.2.22 on Ubuntu 12.04.
I need to disable access to directory
/var/www/abc/
but allow access to file inside this directory/var/www/abc/README.txt
. I try:<Directory /var/www/abc/*> Order allow,deny deny from all <Files /var/www/abc/README.txt> order allow,deny allow from all </Files> </Directory>
But it doens't work - acess to directory is disabled (ok) and file is to disabled (not ok).
What I do bad?
-
alexus about 9 yearsTry to move
<Files>
outside of<Directory>
-
martin about 9 yearsI tried move Files outside Directory and it doesn't work.
-