By Michsk on
Ok so i wanted to know if someone got a 404 page and how they got on it.
1) Go to settings > custom errors (i got a translated version might be a bit differant).
2) For the 404 page set a new page where you want the 404 errors to be send to. I set it to "oeps".
3) Create a new page and make sure the path is the same as you set it to be in the step 2.
4) As content for the 404, give it a nice image or help text or what ever you want.
5) Put the following snippet in the content:
<?php
// YOUR SETTINGS
$mail = "your emailadres";
$header = "404 error";
// DATA
$message = "User got a 404 message:\n\n";
$message .= " USER IP:\t". $_SERVER['REMOTE_ADDR'] ."\n\n";
$message .= " HTTP REFERER:\t". $_SERVER["HTTP_REFERER"] ."\n";
$message .= " ~ is te page where he got from.\n\n";
$message .= " HTTP SELF:\thttp://". $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"] ."\n";
$message .= " ~ the page where he landed.";
// Send
mail($mail, $header, $message);
?>
6) Set the text filter to be php.
Works for me and gets the job done, no fancy spancy html mail just the data you need and how you need it. Maybe someone wants to make it as a module? Might be handy.