I'm trying to use custom error pages configured through .htaccess. 404 works just fine but when it hits 401 it displays the standard error page and logs the following in the error_log:

cannot use a full URL in a 401 ErrorDocument directive --- ignoring

I'm running Apache 1.3.9 on Solaris 9 (sun4u)
Any ideas?

    First, I'd upgrade. 😉 Second, do you mind posting a little bit of you .htaccess file?

      You mean upgrade apache to v2? ...I'm reading that it's not very stable (working with PHP) on Solaris.

      Here's what the .haccess file looks like:

      AuthUserFile /usr/local/access/.pwdfile
      AuthName "Secure Intranet"
      ErrorDocument 401 http://192.168.2.1/err/401.html
      ErrorDocument 404 http://192.168.2.1/err/404.html

      AuthType Basic
      <Limit GET POST PUT>
      order deny,allow
      require valid-user
      allow from 192.168.199.
      satisfy all
      </Limit>

        Apache 1.3.26. stable, bugfixes, security fixes. Yeah, don't use Apache2.x unless it's a dev environment because you will get some of most incredible errors. :p

        Okay. Why not use err/401.html instead?

          Originally posted by dotwebbie

          Okay. Why not use err/401.html instead?

          I did that and guess what:

          [Thu Sep 26 12:08:52 2002] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!

          I figured maybe if I restart apache and try it again it will work but no dice. Still the same error even though I'm not using the full URL.

            Then my only guess is a bug in 1.3.9 . . .

              Originally posted by dotwebbie
              Then my only guess is a bug in 1.3.9 . . .

              I'm beginning to think so too. I even rebooted the system but that didn't fix it either.

                3 years later

                In case anyone else finds this thread and wonders if a resolution was ever found (like I did), here is some info from Apache (Core Features)

                "In addition, if you use a remote URL in an ErrorDocument 401, the client will not know to prompt the user for a password since it will not receive the 401 status code. Therefore, if you use an "ErrorDocument 401" directive then it must refer to a local document."

                Therefore, if you want to redirect a 401 error, you must use something like this in your .htaccess file:

                ErrorDocument 401 /err401.html

                You cannot use these:

                ErrorDocument 401 http://www.someweb.com/err401.html
                ErrorDocument 401 http://1.1.1.1/err401.html

                Hope this helps.

                  Write a Reply...