How can I deny access to a complete folder and sub-folders, with the exception of one file? That file is: toon.php and resides in the same 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.
Order Allow,Deny <FilesMatch "^toon\.php$"> Allow from all </FilesMatch>
That is probably the most efficient that you can get.
AuthGroupFile /dev/null AuthName "Private Area" AuthType Basic AuthUserFile .htpasswd require valid-user <Files "toon.php"> Allow from all Satisfy Any </Files>
Works for me. Dont' forget to configure the .htpasswd file.
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