Forum Moderators: open
Of course, Google shouldn't replace the URI. Moreover, it would be the best if even the current (error) page wouldn't cached but the page would be revisited after some time.
However, since you are trying to communicate a server error, there's no doubt it should be a 500-series response code. I agree with Chico_Loco that 503-Service Unavailable would be preferred, with the generic 500-Server Error as second choice. The 503 response also allows you to specify a Retry-after header, telling the client how long it should wait before retrying the request.
Note: Avoid using 307-Moved Temporarily unless the request was made via HTTP/1.1 or higher -- The 307 code is undefined for HTTP/1.0
Jim
... but why would you not be able to connect to the DB?
We have more than 1 million accesses a week by GoogleBot. Although, database errors are rare, they occur ...
This is an HTTP protocol question, and therefore not Google-specific.
Of course, I have read the status code definitions.
My question is Google specific because I don't want to know which is the correct http code, but I want to know which is best one for GoogleBot, i.e. which neither lead to a replacement of the URI nor the indexing of the error page (the bot should simply revisit the page after some time).
... Retry-after header ...
Has anyone experience with the effect on GoogleBot using this?
In my cart I'm responding with the most requested product when I got a request for the products page without a product ID.
Abdelrhman,
... you may remove the redirection at all; just for the product page and response with the error message from the product page itself ...
Generating a page with the normal header code is not the best option because GoogleBot wouldn't recognize the error and would replace the normal content with the error message.
From my experience so far, 503 seems to be better than 307. I'll try to remove the redirection for GoogleBot and just send the header code.
The only things I haven't tried are a 'Retry-after' or sending nothing. Has anyone experience with this?