Apache: Block all directories except for listed ones
access-control, apache2, directory, regex
Solution
The canonical way is something like:
<Directory />
Order Deny,Allow
Deny from all
</Directory>
<Directory /sandbox>
Order Deny,Allow
Allow from all
</Directory>
<Directory /WebDev>
Order Deny,Allow
Allow from all
</Directory>
<Directory /Projects>
Order Deny,Allow
Allow from all
</Directory>
Problem
I want to block people from accessing every directory except for `/sandbox`, `/WebDev` and `/Projects` I tried this: ``` <Directory ^/(?<!sandbox|Projects|WebDev)+(/.*)> Order Deny,Allow Deny from all </Directory> ``` but it gave a 500 error.