Hi,
with help of the "ErrorDocument" directive placed in .htaccess I installed a PHP handler for requested documents that do not exist.
This handler contains following lines of code:
...
Header("HTTP/1.1 404 Not found");
echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">";
echo "<HEAD><TITLE>SORRY - document not available</TITLE></HEAD><BODY><H1>Not Found !</H1>
The requested URL /fantasy-site.htm was not found on this server!<P>";
echo "</BODY>";
Requesting a document that does not exist by help of a BROWSER works fine: the customized error message is shown up.
BUT requesting the same document name via telnet (port 80) with "GET fantasy-site.htm HTTP/1.1 does not show up my customized error message but the "normal" Apache error message:
HTTP/1.1 404 Not Found
Date: Mon, 14 May 2001 05:40:34 GMT
Server: Apache/1.3.12 OpenSSL/0.9.5a (Unix) PHP/4.0.4pl1
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL /fantasy-site.htm .htm was not found on this
server.<P>
</BODY>
Does anyone know why the browser request shows up the customized error page while telnet fails?
By the way:
I wonder why error.log contains the sites not found EVEN when the customized error handler takes over control (browser mode)?
Mit freundlichem Gruss
Volker