Forum Moderators: open

Message Too Old, No Replies

HTTP Header

Which http header code should be used when redirecting to an error page

         

doc_z

10:58 am on Jun 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Our product pages are dynamically generated. In case of database errors (e.g. connection failed), the user is redirected to an error page. Has anyone experience which header code is the best choice for GoogleBot in this case: 307 (Temporary Redirect), 503 (Service Unavailable) or something else?

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.

Chico_Loco

5:14 am on Jun 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think anyone's ever had to do this - ha ha, but it's a very good question.

I would think 503 - but why would you not be able to connect to the DB?

jdMorgan

5:36 am on Jun 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is an HTTP protocol [w3.org] question, and therefore not Google-specific.

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

doc_z

7:45 am on Jun 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



... 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?

Abdelrhman Fahmy

2:24 am on Jun 7, 2004 (gmt 0)

10+ Year Member



from a similar experience, you may remove the redirection at all; just for the product page and response with the error message from the product page itself, also try to do the same if the User requested the Product page without a specific product ID (most of the SE will request the dynamic product page without a product ID at the first time which will be redirected also in most cases to the Error Message Page,

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,

doc_z

4:15 pm on Jun 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



... 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.

doc_z

8:37 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It seems that none of the methods mentioned prevents Google from caching and showing the error page. Sending a 503 without any content (and just redirect the users to the error page) seems to be the worst choice. In this case the page seems to be completely removed from the SERPs.

The only things I haven't tried are a 'Retry-after' or sending nothing. Has anyone experience with this?