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.
22 |
That is probably the most efficient that you can get. | ||
6 |
Works for me. Dont' forget to configure the .htpasswd file. | ||
6 |
Worked for me... | ||||||||||||
|
4 | You may want to use the http://httpd.apache.org/docs/1.3/mod/core.html#directory http://httpd.apache.org/docs/1.3/mod/core.html#files In short, you want something like this:
| |||
2 | Add the following rule to htaccess file in root
This will deny access to all files and folders except toon.php . | ||
1 | If, like me, you're looking for a way to have authentication on an entire site/folder except for a single file, you will find that this method is working very well:
Example taken from : this site | ||
AllowOverride AuthConfig Limit
in your server config – Daniel Alder Sep 6 '14 at 10:05