No matter how carefully you design your site, visitors will always request a page that is missing, moved, or non-existent (especially if you experiment with your site structure frequently). This past week, I’ve been obsessed with HTTP 404 errors and working on creating a better 404 Not Found page. The default 404 page for WordPress offers the opportunity to search the blog, but you should go another step. Usability is one of (if not the) key trait of a great website. If thought has gone into even your 404 error page, then I’d guess that much thought has been put into your entire site.
Features and characteristics of a great 404 page:
What to do now
If the fault is truly yours and the invalid URL was not created by a crawler bot grabbing email addresses or trying SQL insertions, then you should open up your .htaccess file and redirect them. You shouldn’t have to use mod_write and regular expressions if you are soley creating a list of 1 to 1 relationship URLs. If you create websites for a living, I HIGHLY recommend familiarizing yourself with both powerful tools.
Email the site owner the invalid URL in WordPress
I recommend not sending this to your main email, but one of your secondary email addresses or filtering it to a folder (with the subject “[404 Error]“). I receive more than 10 notices a day from my sites. By placing the URL in the subject line, Gmail will group/thread message about same URL.
<?php $url = $_SERVER[ 'REQUEST_URI' ]; $message = "URL Requested: ".$url_requested; wp_mail("email@example.com", "[404 Error] ".$url_requested, $message); ?>