Forum

Public Directories inside password protected directories

grillmaster
8 March 2016, 03:57
Hi,
I am having trouble figuring out a way to have public directories inside of a password protected directory, without adding a .hiawatha file to each subdirectory. Is this possible?

In the interest of full disclosure, I am setting up an image hosting site, where I would like anyone with the public link of an image to be able to see that image as well as the folder its in. but not be able to see a list of all the folders without a proper password. Also, there will be a lot of folders created on the fly, so I would like to avoid manually adding a .hiawatha file to each subdirectory. So far I have the hiawatha.conf file set up as follows:

VirtualHost {
Hostname = xxxxxxxxxxx.xxx
WebsiteRoot = /var/www/img
StartFile = img.php
AccessLogfile = /var/log/hiawatha/img/access.log
ErrorLogfile = /var/log/hiawatha/img/error.log
ExecuteCGI = yes
AccessList = allow all
UseDirectory = img, img1a

Directory {
DirectoryID = img1a
Path = /img1a
ShowIndex = yes
PasswordFile = basic:/var/www/.password
AccessList = pwd all
}

Directory {
DirectoryID = img
Path = /
PasswordFile = basic:/var/www/.password
AccessList = pwd all
}


I was hoping I could do something like this to allow public access to subdirectories, but it seems that (*) wildcard doesn't work:
Directory {
DirectoryID = img1afolder
Path = /img1a/*
ShowIndex = yes
AccessList = allow all
}
Hugo Leisink
8 March 2016, 23:38
That's not possible. Subdirectories always enherit the access rights of the parent directory.
This topic has been closed.