문제

We have an annual christmas sale on this URL:

www.example.com /christmas-sale/

In February, when the sale is over, we no longer want the URL to be available. However we do want the URL to be available again in a year's time.

Is there a recommended protocol for dealing with a situation like this?

Should we be using a redirect? I figure not, because we are not specifying a new location for the same resource. The resource has become unavailable (if only temporarily).

Should we be using a 404? That doesn't seem like a good idea, because it will lead to a load of dead links from other websites. Ones that will be valid again next year.

도움이 되었습니까?

해결책

Why don’t you add content on this page?

The next christmas sale starts 2014-12-01. Subscribe to our newsletter to get notified when …

That way, users can bookmark the sale URL in their browsers and re-visit it again (not possible if you’d redirect).

If you have to use a different status code than 200, I’d go with 404 (emphasis mine):

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

Of course you could still show content when using 404, so the page doesn’t have to be "dead". But again, I think you should just go with 200. The resource is still there, it just has a different function for your visitors.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top