Mobile app version of vmapp.org
Login or Join
Shanna517

: How to handle redirects & http status codes at urls where a product becomes unavailable? I have this use case that happens frequently: Lots of products for sale, periodically a percentage goes

@Shanna517

Posted in: #HttpHeaders #Redirects #Seo

I have this use case that happens frequently:

Lots of products for sale, periodically a percentage goes out of stock.

A user still browses in on the old url, to a location where a product used to be.

I want to redirect them to a search page, and notify them that the product is no longer available, and try to provide them with alternatives.

At the same time, I want to notify automated services (search engines, shopping engines) that that specific product is gone, in order to prevent continued hits to the urls in question.

What ways are there for gracefully handling this?

Edit: I'm refactoring/recoding the site in custom php code. I also do have a dedicated 404 page, with links to places on the site, etc, but don't really want to duplicate the search page's functionality on the 404 page when a system is already in place in a different php script, and for most 404's I already have a more generic suggestion for alternatives.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shanna517

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gretchen104

You've put the 404 tag on the question whereas a page that returned a 410 ("Gone") error code would be better. For PHP you can do it like this:

header("HTTP/1.1 410 Gone");


before you start doing other output.

Your question is similar to this
Is it better to have an ErrorDocument 404 redirect back to the homepage or a standard 404 error page?
but the accepted answer for that suggests what sounds like one page, whereas your idea of a page which provides alternatives implies there are lots of them, one for each out of stock product.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme