Question
HTTP Status Codes: When to Use 301, 302, 404, and 410
Short answer
Use a 301 when a URL has moved for good, a 302 when it will come back, and a 404 or 410 when the content is gone with no replacement. For Google the choice between 404 and 410 makes no difference: its documentation says "All 4xx errors, except 429, are treated the same". The choices that do matter are elsewhere: permanent versus temporary redirects, real error codes instead of error pages that return 200, and 503 rather than 4xx when a site is down for a short time.
Sources
- 1developers.google.com
- 2developers.google.com
- 3rfc-editor.org
- 4developers.google.com
- 5support.google.com
Ask next
- Redirect Chains and Loops: Detection and Fixes
- HTTPS Migration: SEO Impact and Implementation Guide
- JavaScript SEO: Rendering Issues and Solutions
- Robots.txt: Syntax, Common Mistakes, and Advanced Usage
- Internal Linking Strategy: Link Equity Distribution and Crawl Optimization
- Log File Analysis: Understanding Googlebot Behavior
How Google Reads Each Range
Google’s guide to how HTTP status codes affect its crawlers sets out the behavior:
| Range | What Google does |
|---|---|
| 2xx | Considers the content for indexing; "an HTTP 2xx (success) status code doesn't guarantee indexing" |
| 3xx | Follows "up to 10 redirect hops" by default and processes the final target's content |
| 4xx (except 429) | Doesn't use the content; indexed URLs "are removed from the index" |
| 429 | Treated as "a signal that the server is overloaded"; handled as a server error |
| 5xx | Crawling slows; indexed URLs are "preserved in the index, but eventually dropped" if the errors persist |
Two consequences are worth stating up front. A 200 is not a promise of indexing; it only lets Google consider the page. And a 4xx is a removal signal, while a 5xx is a slow-down signal that turns into removal only if it lasts.
301 and 308: Permanent Moves
A 301 or 308 says the page has moved permanently. Google’s redirects guide says that for permanent redirects “the indexing pipeline uses the redirect as a signal that the redirect target should be canonical”, and that the new target shows in search results. Its advice is to use them “when you’re sure that the redirect won’t be reverted.”
Use a permanent redirect for:
- URL structure changes and domain moves
- HTTP to HTTPS, and
wwwto non-wwwor the reverse - Merging pages whose content now lives in one place
- A removed page that has a real successor
Keep the redirects. Google’s guide to site moves says to keep them “for as long as possible, generally at least 1 year”, because that timeframe “allows Google to transfer all signals to the new URLs”. A redirect removed too early sends returning visitors and old links to an error.
The redirect itself is not the risk. The risks are a missing redirect, a chain of several, or a redirect to a page that doesn’t match what the old URL offered. Google’s site move guide says not to send “many old URLs to one irrelevant single URL destination, such as the home page of the new site”, because it “might be treated as a soft 404 error.” Chains are covered in redirect chains and loops, and domain-level moves in HTTPS migration.
302 and 307: Temporary Moves
A 302 or 307 says the move is temporary. Google’s redirects guide: “Googlebot follows the redirect, but the indexing pipeline doesn’t use the redirect as a signal that the redirect target should be canonical. The target page might still be indexed if other canonicalization signals are present.” Its status code page calls a 302 “a weak signal that the redirect target should be processed.”
Use a temporary redirect when the original URL will return:
- A service that is temporarily unavailable, redirected to a page explaining why; Google gives this example itself
- A short promotion that will end
- Testing that will restore the original URL
If a “temporary” redirect has no end date, it is a permanent one, and should be a 301. Leaving a 302 in place gives Google only a weak signal to treat the target as canonical, which is the opposite of what a lasting move needs.
Why 307 and 308 Exist
For Google, “307 (temporary redirect)” is “Equivalent to 302” and “308 (moved permanently)” is “Equivalent to 301.” The difference matters to browsers and other clients. The HTTP standard, RFC 9110, notes that with a 301 or 302, “For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request”, while with a 307 “the user agent MUST NOT change the request method if it performs an automatic redirection”. Use 307 or 308 when a redirected form submission or API call must keep its method. Google adds that the codes are “semantically different” and recommends using the appropriate one “so other clients (for example, e-readers, other search engines) may benefit from it.”
Other Redirect Methods
Google’s redirects guide orders methods by how likely Google is to interpret them correctly, with server-side redirects first. Meta refresh with a 0-second delay counts as permanent; a delay of more than 0 seconds counts as temporary. JavaScript redirects are a fallback: “Only use JavaScript redirects if you can’t do server-side or meta refresh redirects.” JavaScript sites have their own handling, covered in JavaScript SEO.
404 and 410: Content That Is Gone
Return a 404 or 410 when a page has been removed and nothing on the site replaces it, or when a URL never existed. Google’s handling, from its status code page: the indexing pipeline “removes the URL from the index if it was previously indexed”; “Newly encountered 404 pages aren’t processed”; and “The crawling frequency gradually decreases.”
Choosing between them:
- 404 is the general “not found” response. It suits any removed page with no replacement.
- 410 says the removal is intentional. That is clearer to people and other systems reading your responses, but Google gives it no separate treatment, so don’t expect faster removal from Google Search.
Don’t redirect every removed page to the homepage to avoid 404s. As noted above, Google may treat irrelevant redirects as soft 404s anyway, and visitors looking for a discontinued product learn nothing from the homepage. A useful 404 page, with search and links to the main sections, serves them better while still returning the 404 status.
Soft 404s
A soft 404 is a page that tells visitors the content isn’t there while the server returns 200. The Page indexing report’s help defines it as a page that “returns a user-friendly ‘not found’ message but not a 404 HTTP response code”, and recommends “returning a 404 response code for truly ‘not found’ pages”. Google’s status code page adds that if a 2xx page’s content suggests “an empty page or an error message, Search Console will show a soft 404 error.”
Causes to check:
- A CMS template that shows “No results” or “Product unavailable” with a 200 status
- Empty category, tag or search result pages
- Redirects of many removed URLs to an unrelated page
- Single-page apps that render an error view without changing the status code
Fix each at the source: return a real 404 or 410 for missing content, add content or remove empty listings, redirect only to genuine replacements, and for client-rendered apps use one of Google’s two approaches, a JavaScript redirect to a URL that returns 404, or a noindex added to the error view. Soft 404s also cost crawling: Google’s crawl budget guide says “soft 404 pages will continue to be crawled, and waste your budget.”
500 and 503: Server Errors and Planned Downtime
Google’s status code page says 5xx errors “prompt Google’s crawlers to temporarily slow down with crawling”, that the slowdown is “proportionate to the number of individual URLs that are returning a server error”, and that the indexing pipeline “removes from the index URLs that persistently return a server error.” A spike of 500s is a crawl problem first and an indexing problem if it continues.
For planned downtime, Google’s guide to temporarily pausing a site says that if you need to disable a site “for 1-2 days,” return “an informational error page with a 503 HTTP response status code instead of all content.” For longer closures it recommends an indexable placeholder home page with a 200 status, and it warns: “Completely closing a site even for just a few weeks can have negative consequences on Google’s indexing of your site.” Its other rules for a 503:
- Don’t return 503 for robots.txt, “because this blocks all crawling.”
- Use the
Retry-Afterheader “with a best effort date or duration.” - Keep the error page light: static HTML, inline CSS, few external resources.
And what not to do during a pause, in the same guide’s words: “Don’t block the website by returning 403, 404, 410 HTTP status codes, or with a noindex robots meta tag or x-robots-tag HTTP header. This will remove the website’s URLs from Google Search.” It also advises against the temporary removal tool for closures. Don’t use 401 or 403 to slow Google down either; the status code page says they “have no effect on crawl rate.” How robots.txt itself responds to errors is covered in robots.txt syntax and common mistakes.
A Decision Guide
| Situation | Code |
|---|---|
| Page moved permanently to a new URL | 301 (308 if the method must be kept) |
| Page moved temporarily and will return | 302 (307 if the method must be kept) |
| Page removed, nothing replaces it | 404, or 410 to say the removal is deliberate |
| URL never existed | 404 |
| Content merged into another page | 301 to the merged page |
| Site down for maintenance for a day or two | 503 with <!–INLINECODE4–> |
| Server overloaded by crawling | 503 or 429 for a short period |
| Page exists and should be indexed | 200 with real content |
Monitoring Status Codes
- Page indexing report. Watch “Not found (404)”, “Soft 404”, “Server error (5xx)” and redirect error statuses after releases; see the Page indexing report help.
- URL Inspection. Check what status Google received for a specific URL. Google’s status code page notes that Google’s inspection tools don’t follow redirects, so inspect the final URL as well.
- A site crawl. Find internal links that point to redirects or errors and update them to the final URL, as covered in internal linking strategy.
- Server logs. See which status codes Googlebot actually receives; see log file analysis.
After a redirect or status change goes live, inspect both the old URL and its final target in URL Inspection; Google’s inspection tools don’t follow redirects, so the old URL alone shows the redirect, not what Google receives at the end of it.
Link profile
Links to 6 guides
- Redirect Chains and Loops: Detection and Fixes
- HTTPS Migration: SEO Impact and Implementation Guide
- JavaScript SEO: Rendering Issues and Solutions
- Robots.txt: Syntax, Common Mistakes, and Advanced Usage
- Internal Linking Strategy: Link Equity Distribution and Crawl Optimization
- Log File Analysis: Understanding Googlebot Behavior
Linked from 9 guides
- Thin Content: Identification and Improvement
- Site Architecture and URL Structure for SEO
- Redirect Chains and Loops: Detection and Fixes
- Log File Analysis: Understanding Googlebot Behavior
- Keyword Cannibalization: Detection, Analysis, and Solutions
- JavaScript SEO: Rendering Issues and Solutions
- Content Pruning: Removing Low-Performing Content
- Canonical Tags: Solving Duplicate Content Issues
- Broken Link Building: Finding and Replacing Dead Links
Cites 5 sources
- how HTTP status codes affect its crawlers developers.google.com
- redirects guide developers.google.com
- RFC 9110 rfc-editor.org
- temporarily pausing a site developers.google.com
- Page indexing report help support.google.com