Page 1 of 1

File specific .htaccess authentication [SOLVED]

Posted: Mon May 16, 2005 10:13 am
by pickle
Hi all,

I've got a directory on my server that is protected using an .htaccess file. It's just been requested of me, that I make a specific file in that directory also accessible using a second password. This second password is supposed to allow a user to access the reporting page, and nothing else.

Does anyone have any idea how to do this? Below is the current .htaccess file contents:

Code: Select all

AuthName &quote;Authentication required for the IL webapp&quote;
AuthType &quote;Basic&quote;
AuthUserFILE /path/to/password/file/.htpassword
Require valid-user
Thanks!

Posted: Mon May 16, 2005 10:37 am
by timvw
afaik it's impossible to have a .htaccess for a specific file...

a work-around could be:

create another directory, and symlink to the file in the first directory, and place the second .htaccess/realm in that directory...

Posted: Mon May 16, 2005 11:24 am
by pickle
That worked. Had to upgrade some relative include statements to absolute, but it's working now. Thanks a bunch!