My question is; Do I have to list every directory that I want to password protect in it's own listing<Directory /> ?
Or can I use a relative link somehow to have them all follow the same rule all at once?
The folder at the 3rd level is named differently for each directory path from htdocs.But the folder at the 4th level is named identically the same within each subdirectory of that 3rd level. So the folder at the 4th level is always the same name.
<Directory /> Options FollowSymLinks AllowOverride None # AllowOverride AuthConfig Order deny,allow Deny from all </Directory> #Will password protect the directory from list view <Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder/nonConstantDirNameEx4532_3rdLevel/4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory> #Will password protect the directory from list view <Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder/nonConstantDirNameEx6786_3rdLevel/4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory>
I tried with just two slashes after 2ndLevelFolder:
<Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder//4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory>I also tried an asterisk and a percent sign:
<Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder/*/4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory> <Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder/%/4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory>Is there a way to do such a thing?
Thank you in advance!
Edited by foo, 25 November 2012 - 12:27 PM.











