Apache and .htaccess

a2jfreaka2jfreak Houston, TX Member
edited June 2007 in Internet & Media
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.

[php]
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
[/php]

Comments

  • a2jfreaka2jfreak Houston, TX Member
    edited June 2007
    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?
  • LincLinc Owner Detroit Icrontian
    edited June 2007
    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.
Sign In or Register to comment.