Message 200 OK

wordpress

#1

I have he himself problem of this message: http://blog.dreamhosters.com/forum/programming/58997-200-OK-Message-when-using-php-header-function.htm

Help Please!!

Thanks.


#2

Are you doing a PHP redirect, similar to this?

header(“Location: http://www.example.com”);

If so, what response were you hoping for? 404? 301?

In any case, try adding this before the redirect line.

For a redirect:

header(“HTTP/1.1 301 Moved Permanently”);

Not found?

header(“HTTP/1.1 404 Not Found”);

If you’re not using PHP, or you meant something different, maybe try adding more details about the problem you’re having and someone should be able to help.

If you’re by any chance using an older version of Wordpress, and that’s returning the 200 on all requests, then upgrading would be a good idea.

Also, if you’re trying to 301 all requests, rather than using a 404 for requests that really aren’t there, someone like Google might think you’re being sneaky and hold it against you. :wink:


:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.


#3

I have made everything what you say and always I obtain the same answer: 200 OK. I do not use wordpress. I do not want to use Javascript to avoid problems with google and other search engine.


#4

What does this header checker tell you?

When you 301 to another page, that page will return a 200… as it should. You should see a request or two showing 301, then the final one showing 200.

But if you enter something that truly does not exist, you should get a 404. If you return a 200 or 301 on every single request, Google and others may have a problem with that.

Even though you don’t use wordpress, do you have anything in your .htaccess file that redirects all requests back to the index, then handles them from there?

It would probably look something like this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

If you have something like that, then you would need to look into the code in index.php (or whatever file everything redirects to) and see how that’s handling the errors.


:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.