0

Which HTTP status code should be used when redirecting from a secondary URL to a primary URL?

For example, if the "official" URL of a Contact page is /contact-us and I want to provide /contact as a shorthand convenience, what would be the appropriate status code?

1 Answer 1

1

Use one of these:

  • 301 Moved Permanently
  • 302 Found
  • 303 See Other

From your question I think 303 See other is most appropriate.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for responding. I was scared off by 303 after reading this from the page you linked: "A 303 response to a GET request indicates that the origin server does not have a representation of the target resource that can be transferred by the server over HTTP." However it does seem to be the best available option.
@cantera 303 is appropriate for most use cases. 301 is actually problematic here - the client may establish a permanent association from /contact to /contact-us, but obviously you don't want that to be permanent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.