Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use HTTP Status code 410 for removed stock on a web site?

I'm building a site for a motorcycle dealer, and their used stock changes daily. Currently, when stock is removed, Google Webmaster tools sees Error 404, which I should imagine would damage the reputation of the site with Google.

After doing some research, I found that HTTP status 410 means 'gone permanently'. Should I be using this status code for requests to bikes which are no longer in stock? The page gives a message to say that the bike has been sold, and shows a list of other used stock, just wondering what the correct way of handling these would be.

Thanks in advance

like image 952
ThePHPUnicorn Avatar asked Feb 16 '13 13:02

ThePHPUnicorn


People also ask

What does 410 Gone mean on a website?

Yes, the 410 Gone HTTP status code conveys that the resource requested was once available in the past, but it has now been retired or made obsolete. The 404 Not Found HTTP status code could imply that the website has been incorrectly updated so as to be missing a file that would normally be defined there.

What is http 410 status code?

What is HTTP status code 410? The 410 status code occurs when a user tries to access an asset that no longer exists on the requested server. This happens when the resource is gone permanently and it does not have any forwarding address.

How long does it take to fix an HTTP error 410?

Our experts have had an average response time of 11.87 minutes in July 2022 to fix urgent issues. We will keep your servers stable, secure, and fast at all times for one fixed price. HTTP status code 410 – How to fix? The HTTP status code 410 indicates that access to the target resource is no longer available at the origin server.

Should I use a 410 or 404 status for my website?

If you are going to use a 410 status on a particular resource/page, simply ensure that you want to permanently remove said page. Otherwise, if there is a possibility that the page will be available in the future, it is better to make use of the 404 status.


Video Answer


1 Answers

The status code should refer to the representation of the resource, not the availability of the resource itself. So a page listing an item that is no longer available should still return a 200 status, not 404 or 410.

Then you can list a message on the page saying 'this item is no longer available'. This is similar to how Amazon and eBay handle this problem.

like image 140
Dan Blows Avatar answered Oct 17 '22 03:10

Dan Blows