formmailer Posted March 4, 2012 Share Posted March 4, 2012 Hi! I would like to get an notification/overview of links that result in a 404 error on my site. This includes links on external sites and internal links. Would it be possible to save the $HTTP_REFERERs resulting in a 404, somewhere in the database? /Jasper Link to comment Share on other sites More sharing options...
ryan Posted March 4, 2012 Share Posted March 4, 2012 I think that your best bet for this is your apache log: grep ' 404 ' /path/to/access_log Though that's assuming you are logging referrers in your access log. I also like Google Webmaster tools for finding 404s. You could always create a http404.php template file for ProcessWire, and then have it log the info somewhere: $log = new FileLog($config->paths->logs . '404.txt'); $log->save($sanitizer->text($_SERVER['HTTP_REFERER']) . ' => ' . $sanitizer->text($_SERVER['REQUEST_URI'])); But the above may be overkill since info about 404s is already be tracked in apache logs and web analytics. Link to comment Share on other sites More sharing options...
formmailer Posted March 5, 2012 Author Share Posted March 5, 2012 Thank you Ryan. I was looking for a way to make the 404's easily available for editors, so that they could react on these. But I guess you are right, probably it would be overkill to do this. They can get the data from the webstats and the webmaster tools. /Jasper /Jasper Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now