I have a few aliases setup in the config of a few sites. I have the main htdocs folder with a .htacess file requiring login. If I go straight to any of the aliases, it doesn't require the login. How can I fix this?
Not using aliases will make the directory listing hard to navigate, and reveal a lot of things that shouldn't be public, so that's not an option.
To complicate things, almost everything is a symlink to different places.
I'll do my best to create an example since I can't post the actual config.
Code:
/var/www/example
.htpasswd
htdocs -> /mnt/disk1/Files1 (.htacess is in the actual folder)
list.txt (list of the files/folders in htdocs) (accessible by /list)
new.txt (list of recent updates in htdocs) (accessible by /new)
Media -> /mnt/disk2/Media
Misc -> /mnt/disk2/Misc
Code:
vhost config:
DocumentRoot /var/www/example/htdocs/
Alias /favicon.ico "/var/www/example/favicon.ico"
Alias /list "/var/www/example/list.txt"
Alias /new "/var/www/example/new.txt"
Alias /Media "/var/www/example/Media"
Alias /Misc "/var/www/example/Misc"
Edit: Found a temporary solution. I symlinked the .htaccess in htdocs into /var/www/example.
Still would like a better solution if possible