Customized 404 Page
April 19th, 2007 · by David Bradley
Here is yet another issue to watch out for when you upgrade to a new version of Wordpress or even simply change themes - you may lose your custom 404 error page if you had one in the first place. The Wordpress default theme contains a file called 404.php, which is displayed whenever a visitor hits the site with an addressing pointing to a file that simply does not exist. Most of us are familiar with the tedious information-free 404 pages spewed out by millions of sites across the web when we miss off a trailing l from an “htm” in the filename or misspell a name, or even when said site has relocated files and forgot to 301 redirect them.
Anyway, much better to create a custom 404 page for your own theme, the Wordpress codex has a howto on this very subject, which should provide a good starting point.
There are some significant advantages in getting a custom 404 page setup is that you can redirect readers who may be lost to a useful page, but one latent advantage is that if they stumble upon your admin folders inadvertently and start “trying” different filenames they think might provide a useful way in to your site, then the presence of the 404.php deflects them to an error page rather than displaying your future scheduled posts as it did today on another of my WP sites.


















2 responses so far ↓
The 404.php file is a weird part of wordpress.. the query vars for error=404 get removed if it is a status code 404, but they remain if it is error=anything_else.
Check out what I mean with my 404 plugin.
Thanks for the pointer to your 404 Plugin. Things could get complicated when one is also using a standalone 404 page cited in .htaccess or cPanel as I do with Sciencebase. There the blog is in a sub-folder and there are pages outside the blog heirarchy in the root that nevertheless use the blog theming…
Leave a Comment