- Code: Select all
<Directory ~ "C:/xampp/htdocs/(contrib|forbidden|modperl|modperlasp|restricted|xampp)">
AuthName "Restricted"
AuthType Basic
AuthUserFile "C:\xampp\security\xampp.users"
Require valid-user
</Directory>
<Directory "C:/xampp/htdocs">
<Files ~ "apache">
AuthName "Restricted"
AuthType Basic
AuthUserFile "C:\xampp\security\xampp.users"
Require valid-user
</Files>
</Directory>
Is there a simpler way of doing this? Ideally, I'd like to "negate" a regex pattern, so that I can list the directories I've created, and block access to everything else. But I couldn't figure out a way of doing that with the Apache directives.