Skip to content
Subset

User guide

Status codes

301, 302, 307, 308 and 410 — what each one means, which ones browsers cache forever, and how to pick.

This page is about HTTP rather than about our plugin, and none of it changes when the software ships. It is the reference we kept wanting while building the thing.

The five that matter

CodeNamePermanentMethod preservedCached by browsers
301Moved PermanentlyYesNo (may become GET)Aggressively
302FoundNoNo (may become GET)Only if told to
307Temporary RedirectNoYesOnly if told to
308Permanent RedirectYesYesAggressively
410Gone——Yes

Two axes, and they are independent: permanent or temporary, and whether the request method survives the redirect.

301 is the one that bites

A 301 tells the browser “this moved, forever”. Browsers take that literally and cache it — historically without an expiry, and in several browsers still for the lifetime of the profile. A visitor who hits a wrong 301 once may never reach the correct page again without clearing their cache, and you cannot fix it from the server, because the browser never asks you again.

Why 307 and 308 exist

301 and 302 have a wart: the specification allowed clients to change the request method, and in practice they all turned POST into GET. That is usually what you want for a moved page and never what you want for an API endpoint or a form submission.

307 and 308 are the versions that preserve the method. 307 is the temporary one, 308 the permanent one:

POST /api/v1/orders   →  308  →  POST /api/v2/orders   ✓ still a POST
POST /api/v1/orders   →  301  →  GET  /api/v2/orders   ✗ body discarded

For a redirect between content pages this distinction is invisible, because pages are fetched with GET either way. For anything a machine calls, use 307 or 308.

410 is not a redirect

410 Gone says the resource existed and has been deliberately removed. It is the right answer for a product that is discontinued with no replacement, a campaign page that is over, or a post you retracted.

The alternative people reach for is redirecting to the homepage, and it is worse in both directions. A visitor who wanted a specific page gets dropped somewhere unrelated with no explanation, and search engines treat a mass of unrelated redirects to the homepage as soft 404s — so you get none of the ranking benefit you were hoping for.

What about 404 versus 410?

404 means “I have nothing at this address” — possibly a typo, possibly never existed. 410 means “this was here and I removed it on purpose.”

Search engines de-index a 410 faster than a 404, which is the practical difference. If you want something gone from results, 410 is the stronger signal.

Picking one, quickly

  • The page moved and it is staying moved → 301 (or 308 if anything posts to it).
  • The page moved and you might move it back → 302 (or 307).
  • You are not sure the redirect is right → 302 until you are.
  • The content is gone and has no successor → 410.
  • You are redirecting to the homepage → stop, and use 410 instead.