[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] .htaccess yet again



On Wed, 13 Feb 2002, Edward Bishop wrote:
> This might well be in the archive, but I can't find it; it's one of
> those that gives too many irrelevant hits when searching. I've looked
> in the RaQFaQ and the wider web as well. Also it might not be
> Cobalt-specific so apologies in advance.
> 
> Can .htaccess be used to require authorisation for access a directory
> and then redirect the browser to a custom page if that authorisation
> fails - ie if the user fails three times to supply a valid l/p?
> 
> Here's my .htaccess which should make it clear what I'm trying to do:
> 
> AuthPAM_Enabled off
> AuthUserFile /home/sites/home/web/protected-directory/.htpasswd
> AuthGroupFile /dev/null
> AuthName "Authorised users only"
> AuthType Basic
> <Limit GET PUT POST>
> require valid-user
> </Limit>
> ErrorDocument 403 http://www.mydomain.com/youfailed.htm
> ErrorDocument 401 http://www.mydomain.com/youfailed.htm
> 
401 is correct!
#ErrorDocument 401 /cobalt_error/authorizationRequired.html

--
Gerald Waugh