Are you creating a separate file called "404.php" and putting it in your catalog/includes directory?
Ok, here is a STEP BY STEP TO FIX THE GOOGLE SITEMAP 404 ERROR PROBLEM:
1) Open: catalog/index.php
Near the very top of the file, find around line 13:
require('includes/application_top.php');
Put the following code immediate AFTER the above code:
//START OF 404
if (isset($HTTP_GET_VARS['products_id']) || (isset($cPath) && tep_not_null($cPath))) {
// Attempting to access product or category. Do not redirect to 404.
} else {
$filename = $_SERVER['REQUEST_URI'];
if ($filename == "/") $filename = basename($_SERVER['PHP_SELF']);
if (!file_exists($filename)) {
// Attempting to access a file that we could not find.
require('includes/404.php');
exit;
}
}
//END OF 404
2) Create a new file: catalog/includes/404.php
Put the following code inside of this file:
<?php
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
?>
Code your custom 404 Error page output here...
<p>For example:
<hr>
<h1>404 Not Found</h1>
The file you requested could not be found.
3) Upload both files to the appropriate directory and try going to a URL that you know doesn't exist (i.e.: www.yourserver.com/asdofijsafoij).
If you do this correctly, you should now have a 404 error page that you can customize. When you go to the HTTP Viewer and type in www.yourserver.com/index.php you will get an HTTP Status of 200 OK, but when you type in www.yourserver.com/aosdijoiasdoijf you will get an HTTP Status of 404 NOT FOUND.
Hope this helps,
Doug