According to the Template Manager hit count, my site is getting quite a few 404 hits. I can't seem to locate where those hits are coming in from, whether it's an one old dead link or several, etc.
I would like to have an email automatically sent to me from within my 404 template with segment data at the very least. What's the best way to do this in EE?
The easiest way is to use an add-on that allow you to send an email from within a template. Here are two that work:
Throwing another option in here...
Enable PHP on the 404 template and include a bit of PHP. Something like
mail ( toaddress , subject , message );
Butter that up any way you wish. You could pull out things like the url being requested and include them in the email.
<?php
$url = 'http'.(empty($_SERVER['HTTPS'])?'':'s').'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
mail('[email protected]','404 on website','Hit 404 page on site for URL: '.$url);
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With