File specific .htaccess authentication [SOLVED]

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

File specific .htaccess authentication [SOLVED]

Post 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!
Last edited by pickle on Mon May 16, 2005 11:24 am, edited 1 time in total.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

That worked. Had to upgrade some relative include statements to absolute, but it's working now. Thanks a bunch!
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply