Hi, I'm trying to set up a custom 404 handling page that emails me when it is accessed.
It's kinda working, however if I have in .htaccess
ErrorDocument 404 /error.php
the email is sent ok, with all the variables, but the browser displays the default ie error page.
If i use
ErrorDocument 404 http://www.myurl.com/error.php
the email is sent, but the variables are not there, but the page is displayed in the browser correctly.
Any ideas.
the php code is below...
Error Page
<?php
$to="error@myurl.co.uk";
$subject="404 Error";
$message="404 Page served. Request URI=".$SERVER['REQUEST_URI']." HTTP_REFERER=".$SERVER['HTTP_REFERER']." REDIRECT_URL=".$_SERVER['REDIRECT_URL'];
$headers="header";
if (mail($to, $subject, $message, $headers))
{}
?>
<html>
<head>
<title>Mailsender</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table align="middle">
<tr>
<td>
<a href="http://www.myurl.co.uk"><img src="http://www.myurl.co.uk/acatalog/logo.gif"></a><br>
<p>We are very sorry, but the link you have followed is incorrect. Please go to our <a href="http://www.myurl.co.uk">home page</a>.
</td>
</tr>
</table>
</body>