I try to configure my Apache .conf file to deny listing from a certain category, but I want to allow a specific file inside this category. It appears that the Directory rule is "stronger" than the Files rule, so when using both - I can't access that certain file.
This is what I try:
<Directory /var/www/denied_directory> order deny,allow Deny From All </Directory> <Files safefile.php> Order Allow,Deny Allow from All </Files>
Just add a . htaccess file with the code Deny from all to the folder.
You just need to add a few commands to . htaccess to make it happen. For example, deny from all is a command that will allow you to apply access restrictions to your site.
It works perfectly if it is configured properly:
<Directory /var/www/denied_directory> Order allow,deny <Files test.php> Order deny,allow </Files> </Directory>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With