httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] htaccess with mod_auth_mysql
Date Sat, 28 Jan 2006 16:27:12 GMT
On 1/27/06, Daniel Silva <danielnsilva@gmail.com> 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.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message