You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Christian HAESSIG <ch...@ircad.u-strasbg.fr> on 2007/05/07 15:51:31 UTC

[users@httpd] ErrorDocument 401 problem

Hi,

I'm using apache 1.3.34.

I try to do a redirection on an 401 error in a virtual host. I saw in the
apache FAQ I had to use ErrorDocument 401 /foo/bar

So, that's what I've done.
Here is the virtual host description :

NameVirtualHost *:80

<VirtualHost *:80>
        ServerName toto.ircad.fr
        DocumentRoot /var/www/sites

        ErrorDocument 401 /var/www/sites/untranet_redirect/index.php

        <Directory /var/www/sites/>
                AuthType Basic

                Options Indexes Includes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

As you can see, the redirection should be done to the file
/var/www/sites/untranet_redirect/index.php when an 401 error occurs.
Unfortunately, I get always the following error :

[notice] cannot use a full URL in a 401 ErrorDocument directive ---
ignoring!

when I access the virtual host.

For your information, I also tried with an
ErrorDocument 401 /untranet_redirect/index.php with no more luck, and even
ErrorDocument 401 /untranet_redirect which doesn't work better.

I also tried to put the ErrorDocument line into the <Directory> tag. It does
not work.

The directory /var/www/sites/untranet_redirect exists, and the file
index.php in it too.

Can someone help me with this ?

Thanks,
Christian


---------------------------------------------------------------------
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


RE: [users@httpd] ErrorDocument 401 problem

Posted by Christian HAESSIG <ch...@ircad.u-strasbg.fr>.
Thanks very much, Joshua ; you were right : our web developpers put a faulty
.htaccess.

Christian

> -----Message d'origine-----
> De : jslive@gmail.com [mailto:jslive@gmail.com]De la part de Joshua
> Slive
> Envoyé : lundi 7 mai 2007 17:47
> À : users@httpd.apache.org
> Objet : Re: [users@httpd] ErrorDocument 401 problem
>
>
> On 5/7/07, Christian HAESSIG <ch...@ircad.u-strasbg.fr> wrote:
>
> >         ErrorDocument 401 /var/www/sites/untranet_redirect/index.php
>
> > As you can see, the redirection should be done to the file
> > /var/www/sites/untranet_redirect/index.php when an 401 error occurs.
> > Unfortunately, I get always the following error :
> >
> > [notice] cannot use a full URL in a 401 ErrorDocument directive ---
> > ignoring!
>
> ErrorDocument must be a web-path -- that is, relative to the
> DocumentRoot, not the filesystem root.
>
> But that isn't the main problem here. Apache will only give you that
> error message if the ErrorDocument doesn't start with a "/". So there
> must be somethign else funny going on here.
>
> Perhaps you are editing the wrong config file? Perhaps there is an
> .htaccess file someplace with a faulty 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
>


---------------------------------------------------------------------
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


Re: [users@httpd] ErrorDocument 401 problem

Posted by Joshua Slive <jo...@slive.ca>.
On 5/7/07, Christian HAESSIG <ch...@ircad.u-strasbg.fr> wrote:

>         ErrorDocument 401 /var/www/sites/untranet_redirect/index.php

> As you can see, the redirection should be done to the file
> /var/www/sites/untranet_redirect/index.php when an 401 error occurs.
> Unfortunately, I get always the following error :
>
> [notice] cannot use a full URL in a 401 ErrorDocument directive ---
> ignoring!

ErrorDocument must be a web-path -- that is, relative to the
DocumentRoot, not the filesystem root.

But that isn't the main problem here. Apache will only give you that
error message if the ErrorDocument doesn't start with a "/". So there
must be somethign else funny going on here.

Perhaps you are editing the wrong config file? Perhaps there is an
.htaccess file someplace with a faulty 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