Try using <?php header('Status: 404 Not Found'): ?>
. You can check your server headers using this tool.
Thanks for the suggestions niziol! That tool is pretty handy. I’ve figured out now that wp is not returning the 404.php template when there is a 404. Instead it is returning the archive.php template.
I also seem to have two archive files – archive.php and archives.php – not sure if this is normal.
So the problem now is to try and get wp to use the 404.php for 404s instead of the archive.php.
Back to the codex… If anyone has any ideas!
Thomas
The archive.php and archives.php are both normal. What version of WP are you using?
wp2.0
yeah, had just about figured out the two archives were normal! still don’t know why wp is giving out the archive.php instead of the 404.php
I’ve been having the same exact problem. I even edited my .htaccess file to point to a 404 php page with the single line <?php header('Status: 404 Not Found'): ?>
. But Google still won’t verify it.
Ok, so when a non-existant webpage is requested, wp is returning with the archive.php and not the 404.php.
I’ve gone through I dunno how many pages on the codex and can’t find an explanation for this. According to the Template Hierarchy the hierarchy for an error is
(1) 404.php
(2) index.php
Now i’ve tried deleting the 404.php file and creating it again from scratch. Just in case there was something wrong with the file. That hasn’t changed anything though.
I’d appreciate suggestions as I’m pretty much out of ideas – thanks!
Thomas
Yeah, now I’m having the problem that even when I type in the name of a page that I know isn’t there, it just loads the main index file. Ugh.
hi gegresh,
nice to hear i’m not the only one with this problem!
did you try putting the <?php header(‘Status: 404 Not Found’): ?> or <?php header(“HTTP/1.1 404 Not Found”); ?> in your 404.php?
if you did and that didn’t work. have you figured out that a different template is being used to generate the error page?
thomas
Hmm, I think that is very, very odd – it should do exactly at the hierarchy dictates. Maybe try an update to 2.0.1.
Sorry I don’t have any suggestions, hopefully someone else will!
Cheers,
Michael.
Ok, will have a look at whats involved in updating to 2.0.1. Thanks a lot for your help Michael!
This is the end all, or at least was for me. THIS is EXACTLY what your .htaccess file should look like to get rid of that irritating 200error thing:
—
# BEGIN WordPress
#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteBase /
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]
#</IfModule>
# END WordPress
—
That’s IT. The # in front of each line is just telling the server to ignore the line… you can always remove it if you’d like to back to the old 200 error thing.
Err… without those, then “pretty” permalinks won’t work.
I’ve the same problem, to verify the site the only way is delete or rename .htaccess, after this you can restore the htaccess.
I don’t know why google return this error, i try some online software like http://www.seoconsultants.com/tools/headers.asp and for an head request it return a 404 for non-existent files…
This is almost always a problem with your permalink settings. What do you have those set to?