301 vs 302 vs 410: which status code each old url needs

permanent, temporary or gone — what each code tells browsers and Google, and which one a relaunch needs for which url.

by Max Lorenz, Goodaim · updated

three answers to one old url
  • /services/web-design301
    /services/webdesign
  • /shop (during maintenance)302
    /shop-closed
  • /summer-sale-2019410
    gone on purpose

SHORT ANSWER

Use a 301 when a page has moved for good and the new site has an equivalent: Google treats a 301 as a strong signal that the target should become the canonical url. Use a 302 only when the old url is coming back — Google follows it but treats it as a weak canonical signal, so for a relaunch it is the wrong code. Use a 410 when a page is gone on purpose and nothing on the new site replaces it; Google drops 4xx urls from the index, and a 410 says the removal was deliberate rather than an accident.

The three codes side by side

301 moved permanently302 found410 gone
HTTP meaningthe resource has a new permanent urithe resource is temporarily under a different urino longer available, likely permanently
Google's treatmentfollowed; strong signal the target is canonicalfollowed; weak signal the target is canonicaltreated like other 4xx: not indexed, removed if indexed
cached by browsersyes, heuristically — a wrong 301 can sticknot by defaultyes, heuristically
visitor seesthe new pagethe temporary pagean error page (make it a useful one)
use in a relaunch forevery old url with an equivalent or a sensible categorynothing that is moving for goodurls removed on purpose, with no replacement

Sources: the definitions in RFC 9110, the HTTP semantics specification; Google’s treatment from how HTTP status codes affect Google’s crawlers and redirects and Google Search.

301: the relaunch default

RFC 9110 defines it in one sentence: the target resource “has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs.” Google’s redirects documentation describes what follows from that for search: “Googlebot follows the redirect, and the indexing pipeline uses the redirect as a signal that the redirect target should be canonical.”

That is exactly what a relaunch wants. The old url is retired, the new one takes its place in the index, and links pointing at the old address keep reaching the page. Google’s site move guide asks for the redirects to stay “for as long as possible, generally at least 1 year.”

one thing to know before shipping — the specification makes a 301 heuristically cacheable, so browsers may remember it without asking the server again. A wrong 301 can keep sending returning visitors to the wrong page after you fix the rule. Test the map before it goes live, not after.

a 301 to the right place — the target should be the page that answers the same question. Google’s guide warns against redirecting many old urls to one irrelevant destination such as the homepage: it “can confuse users and might be treated as a soft 404 error.”

EXAMPLE

/leistungen/webdesign becomes /services/web-design on the new English site. Same service, same intent: a 301, and the old url drops out of the index as the new one is picked up.

302: only for what is coming back

RFC 9110: the target resource “resides temporarily under a different URI.” Google: “Googlebot follows the redirect, but the indexing pipeline doesn’t use the redirect as a signal that the redirect target should be canonical.” The old url is the one you are telling everyone to keep.

Where a 302 is the honest answer:

  • a section taken offline for maintenance, with the url coming back afterwards.
  • a product page sending visitors to a notice while stock is out, when the page will return.
  • routing by language or location where the original url stays the entry point.

None of these is a relaunch. A 302 slips into a migration mostly by default: some servers, frameworks and plugins write a temporary redirect unless told otherwise. If your redirect test shows 302s on old urls, change the rule type — Google may still work out the move from other signals such as canonical tags and internal links, but a 301 removes the guesswork.

EXAMPLE

a shop closes its /sale page for the two weeks between campaigns and sends visitors to /newsletter in the meantime. A 302: when the next sale starts, /sale should still be the url in the search results.

410: gone on purpose

RFC 9110 defines a 410 as a resource that is “no longer available at the origin server and that this condition is likely to be permanent.” A 404 only says nothing was found — without a claim about whether it is permanent (section 15.5.11).

For Google the two end the same way. Its status code documentation says all 4xx errors except 429 are treated alike, and that “URLs that are already indexed and return a 4xx status code are removed from the index.” So the reason to choose 410 is not a ranking trick; it is precision. A 410 documents a decision — in your logs, in your redirect test and for every other client that reads status codes — where a 404 could just as well be a forgotten rule.

When a 410 beats a redirect:

  • an expired campaign or event page with no successor and no meaningful links.
  • a discontinued product whose category no longer exists either.
  • thin pages removed on purpose — tag archives, filtered listings, test pages that leaked into the index.

And when it does not: a url with backlinks or steady traffic deserves a target, even an imperfect one like the nearest category. The 410 is for urls whose value is already zero.

EXAMPLE

/webinar/2021-03-relaunch — the event is over, nothing links to it, and the new site has no webinar section. A 301 to the homepage would be a soft 404 in disguise; a 410 is the truthful answer.

307, 308, 404 and the redirects that are not status codes

308 permanent redirect — Google: equivalent to 301. The difference is for browsers and api clients — after a 308 the request method must not change, so a form POST stays a POST. Fine for a relaunch if your server writes it.

307 temporary redirect — Google: equivalent to 302, with the same method guarantee as 308. Chrome’s developer tools also show a 307 when HSTS upgrades http to https inside the browser — that one never came from the server.

303 see other — Google groups it with the temporary redirects. Meant for sending a client to a result page after a form submission; not a relaunch tool.

404 not found — what every old url without a rule returns. For Google it ends like a 410, but it is ambiguous to you: it does not say whether the url was retired or forgotten.

meta refresh — Google reads an instant meta refresh as a permanent redirect and a delayed one as a temporary redirect. Only for hosts where you cannot set server-side redirects.

javascript redirects — Google’s advice is to use them only if neither server-side nor meta refresh redirects are possible, because if rendering fails, Google might never see them.

Deciding url by url

Three questions settle the code for every row of a redirect map:

questionif yesif no
Is the url coming back at the same address?302 (or 307)go on
Does a page on the new site answer the same question?301 to that pagego on
Does the topic still exist, or does the url hold links or traffic?301 to the nearest category410

Most rows stop at the second question. The point of building the map with a tool is to make that question cheap: Silentfrog crawls the old and the new site, pairs identical paths, scores the remaining pages on slug, title and h1, and leaves the uncertain ones in a review bucket. Every row it exports is a 301 — in the generic csv the status_code column says so, and the importer formats write 301 rules. The urls it leaves unmatched stay in the generic csv with an empty target, which makes them the short list to go through for 410s; the 410 itself is set on your server or platform. More on building the whole map in 301 redirects for a website relaunch.

The mistakes each code invites

  • 301 everything to the homepage. Looks handled, behaves like a soft 404. One-to-one targets or the nearest category instead.
  • 302 by default. A server or plugin writing temporary redirects for a permanent move. Check the status in your redirect test, not just the destination.
  • 301 to a page that redirects again. A chain — each extra hop is avoidable. See redirect chains and loops.
  • 410 on a url with links. The links lose their target and the value they carried. Check backlinks and clicks before deciding a url is worthless.
  • a 200 “page not found”. An error page that answers 200 is a soft 404 too. Removed pages should return a real 410 or 404.

In short

  • 301: moved for good, and Google uses it as a strong canonical signal — the code for every old url with a target.
  • 302: temporary, a weak canonical signal — right only when the old url is coming back.
  • 410: gone on purpose; Google treats it like any 4xx and removes the url, and it documents that the removal was a decision.
  • 308 equals 301 and 307 equals 302 for Google; the difference is the request method.
  • Never send unrelated urls to the homepage — Google may treat that as a soft 404.

To get the 301 half of the map done quickly, crawl both sites in Silentfrog; the first 50 pages are free.