Non-Existent URLs Don’t Redirect To Custom 404 Page
If your blog situation is exactly what has been described below (from nos. 1 to 5) , use the solution indicated at the bottom :
- When a fake url like www.tipsofallsorts.com/abcdefgh is entered, the custom 404.php that is found in the active theme folder refuses to show up, instead it is being redirected to the template belonging to page.php.
- Your permalink custom structure is : /%category%/%postname%/
- The fake url page gives a 200 status.
- < ?php header("HTTP/1.1 404 Not Found"); ?> has been included before < ?php get_header(); ?> in error.php.
- You have deactivated all the plugins and then reactivated them one by one but found none of them were giving problems. The Ultimate Tag Warrior (UTW) could disrupt permalinks.
- The .htaccess file reads :
DirectoryIndex index.php index.html
AddType text/x-server-parsed-html .html .htm
ErrorDocument 404 /index.php?error=404RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
# END WordPress
Add this to the top of single.php, page.php or category.php right above < ?php get_header(); ?> :
< ?php if (!have_posts()) { include(get_404_template()); exit; } ?>
This thread from the Wordpress support forum provided the solution :
http://wordpress.org/support/topic/99239
More helpful information :
http://wordpress.org/support/topic/93890
http://codex.wordpress.org/Permalinks
Subscribe to my RSS feed for regular updates.




Nice solutions! I looked all over for this… I wish I wouldve seen that support link before writing the Google 404 plugin..
@ http://www.askapache.com/seo/404-google-wordpress-plugin.html