httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] htaccess with mod_auth_mysql
Date Sat, 28 Jan 2006 16:27:12 GMT
On 1/27/06, Daniel Silva <> wrote:
> Hi,
> I have a .htaccess file in a direcory of my web server, that contains:
> -------------------------------------------------------------------------------------------
> AuthName "Conteudo exclusivo"
> AuthType Basic
> AuthMySQLUser usuario
> AuthMySQLPassword senha
> AuthMySQLDB banco
> AuthMySQLUserTable tabela
> AuthMySQLNameField usuario
> AuthMySQLPasswordField senha
> require valid-user
> ErrorDocument 401 /solicitar_acesso.php
> -------------------------------------------------------------------------------------------
> The question is: when i try to access a file in the protected
> directory, cancelling the authentication, the file
> "solicitar_acesso.php" is loaded, but on load, trying to open CSS
> files e images of the page, the authentication is required again, and
> if don´t make it the files don´t open. The file "solicitar_acesso.php"
> and others files aren´t in the protected directory.

When apache servers the errordocument, it doesn't tell the browser the
location that it is serving from, so the browser still sees the URL as
being the originally requested (authenticated) url.  Hence all
relative URLs in the errordocument will be interpreted relative to the
authenticated document.

The fix is to use only absolute URLs (starting in http:// or at least
/) in the errordocument.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message