Reputation: 1903
I have web structure like this:
root
folder1
folder2
errors
resouces
...
index.php
and I want to deny access to all subdirectories exept errors. I don't want to have .htaccess in every single subdirectory, just one in root. Any tips?
Upvotes: 1
Views: 265
Reputation: 3749
You can set an environment variable if the request contains a /errors
, doing something like this in your htaccess file:
SetEnvIf Request_URI /errors iserrors=1
Order Deny,Allow
Deny from all
Allow from env=iserrors
Upvotes: 1