PDA

View Full Version : Apache and .htaccess


a2jfreak
26 Jun 2007, 10:52pm
If I try to access directory X and file Y, I'm allowed to view the file, rather than it asking for a user/pass.

Here's my .htaccess file, please tell me what is wrong.


AuthName "Add your login message here."
AuthType Basic
AuthUserFile /var/www/html/csm/X/.htpasswd
AuthGroupFile /var/www/html/csm/X/.htgroup
require group csm

<Files "Y.php">
require group csm
</Files>

ErrorDocument 404 /errorDoc.html
ErrorDocument 403 /errorDoc.html

Options -Indexes

a2jfreak
26 Jun 2007, 10:59pm
Ok, Nevermind. I just closed the browser and re-tried and it worked. So I guess the authorization information lasts for the entire time the browser is open.

Anyway, next question: how can I make it so that if the authorization hasn't occurred in the last X minutes then Apache will ask again?

Lincoln
27 Jun 2007, 1:07am
I don't know Apache well enough to field this, but why are you using Apache to create a permission structure instead of PHP? This seems like what sessions are for.