Comparison

The status codes that decide what happens to a URL

Six codes do almost all the work, and choosing between them is a decision about what you want a search engine to remember. A redirect tells it to move its record to somewhere else; a 404 tells it this address is empty today; a 410 tells it the address is finished with.

5 related tools

Side by side

The status codes that decide what happens to a URL
CodeMeansPasses ranking onMethod after redirect
301Moved permanentlyYesCan change POST to GET
302Found, temporarily elsewhereStays with the originalCan change POST to GET
307Temporary redirectStays with the originalPreserved
308Permanent redirectYesPreserved
404Not foundNothing to passn/a
410Gone, deliberatelyNothing to passn/a

The short answer

Use 301 when the new address is the one you want remembered, and 302 when the old one is coming back. The difference between 307 and 302 only shows on a form submission, where the older codes are permitted to turn a POST into a GET and quietly lose what was submitted. And when a page is genuinely retired rather than missing, a 410 says so, which clears it from an index noticeably faster than a 404 that might just be a mistake.

In more detail

Why 307 and 308 exist at all

The original specifications allowed a client receiving a 301 or 302 to change a POST into a GET when it followed the redirect, and browsers did exactly that. For a form submission it means the data quietly goes nowhere. 307 and 308 were defined to forbid the change, which is why the difference between 302 and 307 is invisible on an ordinary page and decisive on a form.

410 clears an index faster than 404

A 404 might be a mistake - a typo, a temporary failure, a page that will come back - so crawlers retry it for a long time. A 410 says the page is deliberately finished with, and it is dropped considerably sooner. For pages genuinely retired, saying so is worth the small effort of configuring it.

Redirect chains cost more than they look

Each hop is a round trip before anything renders, and long chains are eventually abandoned. When a URL has moved twice, point the original at the final destination rather than letting it walk the chain. The same applies to the http to https to www sequence, which is three hops when it could be one.

Tools covered by this comparison

More comparisons