Cannot use a full URL

Today I noticed the following lines in the Apache error_log file:

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

Of course, we do not like to waste the error_log file so I tried to find a solution to the problem.

In the present case, the problem was caused by the ErrorDocument file that was provided in the document_root directory for the domain name, as follows:

ErrorDocument 401 http://domain.tld/errorpage.html

This row had to be modified as follows:

ErrorDocument 401 /errorpage.html

If you have multiple web pages served by the Apache webserver it may be useful to look at all the .htaccess files in the document_root directory for domain names.

find -name '.htaccess' -exec grep ErrorDocument {} \; -print