---
title: "Choose the right HTTP status code for each URL and keep Google's index clean"
description: "Learn what 200, 301, 302, 307, 308, 404, 410, 403, 500, and 503 mean to Google, when to use each one, and how to find and fix wrong codes."
canonical: "https://scalewithsearch.com/articles/http-status-codes-seo"
date: "2026-03-20"
modified: "2026-09-25"
---
## Site navigation

- [Scale With Search](https://scalewithsearch.com/)
- Real estate
  - Real estate
    - [Real estate](https://scalewithsearch.com/for/real-estate)
- Work
  - Start here
    - [Send your brief](https://scalewithsearch.com/work#send-your-brief)
    - [Prepare your six-question brief](https://scalewithsearch.com/work#prepare-your-six-question-brief)
  - Build
    - [Site build, content library with SEO, signal desk](https://scalewithsearch.com/work)
- For your business
  - Trades and home services
    - [Auto body and collision shops](https://scalewithsearch.com/for/auto-body-and-collision-shops)
    - [Foundation and home repair contractors](https://scalewithsearch.com/for/foundation-and-home-repair)
    - [Garage door and fencing contractors](https://scalewithsearch.com/for/garage-door-and-fencing-contractors)
    - [HVAC contractors](https://scalewithsearch.com/for/hvac-contractors)
    - [Janitorial and commercial cleaning companies](https://scalewithsearch.com/for/janitorial-and-commercial-cleaning)
    - [Locksmiths](https://scalewithsearch.com/for/locksmiths)
    - [Moving companies](https://scalewithsearch.com/for/moving-companies)
    - [Pest control companies](https://scalewithsearch.com/for/pest-control-companies)
    - [Plumbing and electrical contractors](https://scalewithsearch.com/for/plumbing-and-electrical-contractors)
    - [Restoration and water or fire damage companies](https://scalewithsearch.com/for/restoration-and-water-fire-damage)
    - [Roofing companies](https://scalewithsearch.com/for/roofing-companies)
    - [Towing companies](https://scalewithsearch.com/for/towing-companies)
    - [Tree services and landscaping companies](https://scalewithsearch.com/for/tree-services-and-landscaping)
    - [Solar installers](https://scalewithsearch.com/for/solar-installation)
    - [General contractors](https://scalewithsearch.com/for/general-contractors-and-construction)
    - [Paving, concrete, and flooring contractors](https://scalewithsearch.com/for/paving)
  - Practices and professional services
    - [Bookkeeping and tax practices](https://scalewithsearch.com/for/bookkeeping-and-tax-practices)
    - [Dental practices](https://scalewithsearch.com/for/dental-practices)
    - [Family and criminal defense law firms](https://scalewithsearch.com/for/family-and-criminal-defense-law-firms)
    - [Med spas and aesthetics practices](https://scalewithsearch.com/for/med-spas-and-aesthetics)
    - [Personal injury law firms](https://scalewithsearch.com/for/personal-injury-law-firms)
    - [Veterinary clinics](https://scalewithsearch.com/for/veterinary-clinics)
    - [Gyms and fitness studios](https://scalewithsearch.com/for/fitness)
    - [Therapy and outpatient health practices](https://scalewithsearch.com/for/therapy-and-outpatient-health)
    - [Medical billing companies](https://scalewithsearch.com/for/medical-billing)
    - [Insurance agencies](https://scalewithsearch.com/for/insurance-agencies)
    - [Financial advisors](https://scalewithsearch.com/for/financial-advisors)
    - [Property management companies](https://scalewithsearch.com/for/property-management)
    - [Recruiting and staffing agencies](https://scalewithsearch.com/for/recruiting-and-staffing)
    - [Architects and interior designers](https://scalewithsearch.com/for/architects-and-interior-designers)
    - [Logistics and supply chain companies](https://scalewithsearch.com/for/logistics-and-supply-chain)
  - Agencies, MSPs, and manufacturing
    - [IT and managed service providers](https://scalewithsearch.com/for/it-and-managed-service-providers)
    - [Machine shops and precision manufacturers](https://scalewithsearch.com/for/machine-shops-and-precision-manufacturing)
    - [Marketing agencies and freelancers](https://scalewithsearch.com/for/marketing-agencies-and-freelancers)
    - [SEO agencies and consultants](https://scalewithsearch.com/for/seo-agencies-and-consultants)
    - [Small manufacturers and fabricators](https://scalewithsearch.com/for/small-manufacturers-and-fabricators)
  - Restaurants, shops, studios, and nonprofits
    - [Restaurants and hospitality businesses](https://scalewithsearch.com/for/restaurants-and-hospitality)
    - [Retail stores and ecommerce sellers](https://scalewithsearch.com/for/retail-and-ecommerce)
    - [Photographers, event planners, and travel agents](https://scalewithsearch.com/for/photographers)
    - [Churches and nonprofits](https://scalewithsearch.com/for/churches-and-nonprofits)
  - [All industries](https://scalewithsearch.com/for/)
- Learn
  - For your office
    - [Office job guides](https://scalewithsearch.com/guides/)
    - [Browser calculators](https://scalewithsearch.com/tools/)
  - Start here
    - [How it works](https://scalewithsearch.com/how-it-works)
    - [Free Starter Kit](https://scalewithsearch.com/kit/business-memory-starter-kit.zip)
    - [Synthetic specimen](https://scalewithsearch.com/specimen/working-session-specimen.zip)
  - Guides
    - [The Complete Guide to Business Memory for AI Agents](https://scalewithsearch.com/articles/business-memory-for-ai-agents-guide)
    - [The Complete Small-Business Guide to AI Agent Governance](https://scalewithsearch.com/articles/ai-agent-governance-guide-small-business)
    - [The Complete Guide to Leaving Vendor AI Memory](https://scalewithsearch.com/articles/leaving-vendor-ai-memory-guide)
  - Articles by cluster
    - [Business memory](https://scalewithsearch.com/articles/business-memory-for-ai-agents-guide)
    - [Agent governance](https://scalewithsearch.com/articles/ai-agent-governance-guide-small-business)
    - [Migration and ownership](https://scalewithsearch.com/articles/leaving-vendor-ai-memory-guide)
  - For machines
    - [llms.txt](https://scalewithsearch.com/llms.txt)
    - [llms-full.txt](https://scalewithsearch.com/llms-full.txt)
    - [Machine view](https://scalewithsearch.com/?view=machine)
- Company
  - Evidence
    - [Proof](https://scalewithsearch.com/proof)
  - Company
    - [About](https://scalewithsearch.com/about)

# Choose the right HTTP status code for each URL and keep Google's index clean.

A developer moves 200 product pages to new URLs with 302 redirects, because 302 is the framework default. Three months later, Google still shows the old URLs in search results. Another site returns `200 OK` on its "Page not found" template, and Search Console reports 4,000 soft 404 pages.

An HTTP status code is the three-digit number a server returns with each response. Browsers and Googlebot both read it. Most developers know `200 OK` and `404 Not Found`. The differences between `301`, `302`, `307`, and `308`, between `404`, `410`, and a soft 404, and between `500` and `503` change how Google crawls and indexes your URLs. This article explains what each code means to Google, when to use it, and how to audit a site for wrong codes.

## Know the five code classes

| Class | Meaning | Codes that matter for SEO |
|---|---|---|
| 1xx | Informational. The request continues. | None |
| 2xx | Success. | `200 OK` |
| 3xx | Redirection. The client must follow a new location. | `301`, `302`, `307`, `308` |
| 4xx | Client error. The request cannot be fulfilled. | `404`, `410`, `403`, `429` |
| 5xx | Server error. A valid request failed. | `500`, `503` |

## Return 200 only for real pages

`200 OK` means the page loaded. Google can crawl, index, and rank it. Return `200` for every page you want in search results.

Do not return `200` for a page that does not exist. That creates a soft 404, which this article covers below.

## Pick the right redirect

### 301 Moved Permanently

A `301` tells clients that the URL moved for good. Use it in four cases:

- You migrate a URL structure.
- You move to a new domain.
- You force one version of the site, such as `http` to `https`, or `www` to the bare domain.
- You merge duplicate pages into one URL.

Google follows the redirect and treats it as a strong signal that the target URL is canonical. It replaces the old URL with the new one in search results over time, usually within a few weeks. In 2016, Google's Gary Illyes said that 3xx redirects no longer lose PageRank. Older guides that say a 301 passes "90 to 99 percent" of link equity are out of date.

```
Request: GET /old-page
Response: 301 Moved Permanently
Location: /new-page
```

In Nginx:

```nginx
location /old-page {
  return 301 /new-page;
}
```

In Apache `.htaccess`:

```apache
Redirect 301 /old-page /new-page
```

In Next.js:

```javascript
// next.config.js
module.exports = {
  async redirects() {
    return [
      {
        source: '/old-page',
        destination: '/new-page',
        permanent: true, // Next.js sends 308, not 301
      },
    ];
  },
};
```

Next.js sends `308` for `permanent: true` and `307` for `permanent: false`. Google treats `308` like `301` and `307` like `302`, so the result for search is the same.

Keep a permanent redirect for at least one year, and longer while links still point to the old URL. If you remove a redirect, the old URL returns a 404. Any links that still point to it then lead nowhere.

### 302 Found

A `302` tells clients that the move is temporary and the original URL will return. Use it for a short promotion or a temporary maintenance page. Also use it for a test that sends some visitors to a variant.

Google follows a `302` but treats it as a weak canonical signal. It usually keeps the original URL in the index. That is the right result for a temporary move and the wrong result for a permanent one.

```
Request: GET /promo-page
Response: 302 Found
Location: /landing-page
```

A common mistake is a `302` for a permanent migration, often because it is a framework default. The new URLs then take longer to replace the old ones in search results. If a "temporary" redirect has been live for six months or more, it is permanent. Change it to `301`.

### 307 and 308

A `307 Temporary Redirect` is a `302` that keeps the HTTP method and body. A `POST` stays a `POST`. A `308 Permanent Redirect` is a `301` with the same guarantee. A `301` or `302` can let a client change a `POST` into a `GET`.

Use `307` or `308` when you redirect form submissions or API calls that must keep their method. For search, Google treats `307` like `302` and `308` like `301`. All current browsers support both codes.

## Handle missing and removed pages

### 404 Not Found

A `404` means the server has no page at that URL. Use it when a page was deleted with no replacement, or when a URL was never valid. Also use it when temporary content expired and has no successor.

Google drops a URL that returns `404` from the index over time. No link value passes from a `404` page. Some 404s are normal: old URLs, broken external links, and typos. They do not hurt rankings on their own. Large numbers of 404s from your own internal links do waste crawl requests. Fix the internal links.

```
Request: GET /nonexistent-page
Response: 404 Not Found
```

Do not return `404` when a relevant replacement exists. Redirect to the replacement instead. Do not redirect every 404 to the homepage. Google treats an irrelevant redirect target as a soft 404. Check the `Not found (404)` reason in the `Page indexing` report in Search Console. Redirect or restore the pages that still get traffic or links.

### 410 Gone

A `410` means the page existed and was removed on purpose. Use it for discontinued products with no successor, expired promotions, and content you want out of the index.

```nginx
location /deleted-product {
  return 410;
}
```

Google's documentation treats all 4xx codes except `429` the same way: the content does not exist. Google staff have said that a `410` can drop a URL a little faster than a `404`, but the difference is small. Use `410` when you know the removal is final. Use `404` in every other case. The [out-of-stock pages guide](/articles/out-of-stock-pages-seo) covers the choice for ecommerce products.

### 403 Forbidden

A `403` means the server refuses the request. Use it for admin areas and other content that needs a login.

Googlebot does not log in. Google treats a `403` like other 4xx codes and does not index the page. A common mistake is a firewall or bot rule that returns `403` to Googlebot on public pages. Check your security rules if public pages disappear from the index.

### 429 Too Many Requests

A `429` asks the client to slow down. Google treats `429` like a server error. It reduces its crawl rate. Do not use `429` to block Googlebot for long periods.

### Soft 404

A soft 404 is a page that returns `200 OK` but shows "not found" content:

```
Request: GET /missing-page
Response: 200 OK
Body: <h1>404 - Page Not Found</h1>
```

Google detects many of these pages and excludes them, with the reason `Soft 404` in the `Page indexing` report. The problem is waste. Google must fetch and analyze each one before it can exclude it. Pages that Google misreads can stay in the index as thin content.

Fix it by returning a real `404` with your custom error page. In Nginx, `error_page` serves the custom page with the `404` status:

```nginx
error_page 404 /404.html;
location = /404.html {
  internal;
}
```

In the Next.js Pages Router, `pages/404.js` returns a `404` status:

```javascript
// pages/404.js
export default function Custom404() {
  return <h1>404 - Page Not Found</h1>;
}
```

In the App Router, call `notFound()` in a route and add an `app/not-found.js` file for the content. Next.js then returns `404`.

## Respond to server errors

### 500 Internal Server Error

A `500` means the server failed. Common causes are a broken configuration, a code error such as an unhandled exception, and a lost database connection.

When Googlebot sees many 5xx responses, it slows its crawl rate. URLs that keep returning 5xx errors drop out of the index over time. A short outage of a few hours rarely causes lasting harm.

When 5xx errors appear:

1. Read the server error logs.
2. Fix the code or the configuration.
3. Watch the `Server error (5xx)` reason in the `Page indexing` report in Search Console.

If `robots.txt` itself returns a 5xx error, Google pauses the crawl of the whole site until it can read the file again. Keep `robots.txt` on the most reliable part of your stack.

### 503 Service Unavailable

A `503` means the server is down for a short time, for planned maintenance, an upgrade, or overload. Google pauses and retries later. A `503` for a few hours causes no harm. If the site returns `503` for more than a few days, Google starts to treat the URLs as gone.

Send a `Retry-After` header that tells clients when to return. This value asks them to retry in one hour:

```
Response: 503 Service Unavailable
Retry-After: 3600
```

In Nginx, add the header with `always`, because Nginx adds headers to error responses only with that flag:

```nginx
location / {
  add_header Retry-After 3600 always;
  return 503;
}
```

## Remove redirect chains and loops

### Chains

A chain is a redirect to a URL that redirects again:

```
/old-page → 301 → /intermediate-page → 301 → /final-page
```

Each hop costs a round trip for users and a crawl request for Googlebot. Googlebot follows up to 10 hops. After that, it reports a redirect error. Point every old URL straight at the final target:

```
/old-page → 301 → /new-page
/temp-page → 301 → /new-page
```

Find chains with Screaming Frog or Ahrefs Site Audit. The [301 redirect chain guide for developers](/articles/redirect-chains-301-developers) covers bulk fixes after a migration.

### Loops

A loop sends page A to page B and page B back to page A:

```
/page-a → 301 → /page-b
/page-b → 301 → /page-a
```

Neither page can be indexed, and users see a "too many redirects" error. Search Console reports loops under the `Redirect error` reason. Remove the circular rule.

## Protect crawl capacity

Crawl budget is the number of URLs Googlebot will crawl on your site in a given period. It matters most for large sites. Some responses waste it: redirect chains, internal links to 404 pages, soft 404 pages, and repeated 5xx errors that Googlebot retries. Direct 301 redirects and correct 404 or 410 codes use it well. The [robots.txt and crawl budget guide](/articles/robots-txt-crawl-budget-developers) covers the other levers.

Your server logs show which status codes Googlebot received. The [log file analysis guide](/articles/log-file-analysis-seo) shows how to read them.

## Audit status codes on a schedule

In Google Search Console, open `Indexing`, then `Pages`. Check four reasons. `Server error (5xx)` needs a fix at once. `Redirect error` means a chain or a loop. `Not found (404)` needs a review of pages that still get traffic. `Soft 404` means an error page returns `200`.

In Screaming Frog:

1. Crawl the site.
2. Open `Response Codes`, then filter to `Client Error (4xx)` or `Server Error (5xx)`.
3. Export the URLs.
4. Fix each URL or redirect it.

In Ahrefs Site Audit, run an audit, open `Issues`, and filter for broken pages and redirect chains. Export the list and fix it.

To check one URL, open Chrome DevTools, select the `Network` tab, and reload the page. The status column shows the code. From a terminal:

```bash
curl -I https://example.com/page
```

## Use this quick reference

| Situation | Status code |
|---|---|
| The page loads | `200 OK` |
| The URL moved for good | `301 Moved Permanently` (or `308`) |
| A short, temporary redirect | `302 Found` (or `307`) |
| The page was deleted with no replacement | `404 Not Found` |
| The page was removed on purpose and will not return | `410 Gone` |
| The page needs a login | `403 Forbidden` |
| The server failed | `500 Internal Server Error` |
| Planned maintenance | `503 Service Unavailable` with `Retry-After` |

----

```text
                  .|########||.                                       .|########||.                                       .|########||.
               |##||.      .||##|.                                 |##||.      .||##|.                                 |##||.      .||##|.
             |#|.              .|#|.                             |#|.              .|#|.                             |#|.              .|#|.
           |#|                    |#|                          |#|                    |#|                          |#|                    |#|
         .#|                        |#.                      .#|                        |#.                      .#|                        |#.
        .#.                          .#|                    .#.                          .#|                    .#.                          .#|
       |#.                            .#|                  |#.                            .#|                  |#.                            .#|
      |#             ......             #|                |#             ......             #|                |#             ......             #|
     .#           ||#########|           #|              .#           ||#########|           #|              .#           ||#########|           #|
    .#.         |######||######|.        .#.            .#.         |######||######|.        .#.            .#.         |######||######|.        .#.
    #.        .##|###|##|#|######|        .#            #.        .##|###|##|#|######|        .#            #.        .##|###|##|#|######|        .#
   ||        |##|#||||||||||||#||#|        ||          ||        |##|#||||||||||||#||#|        ||          ||        |##|#||||||||||||#||#|        ||
   #        |#||||||||||||||||||||#|        #.         #        |#||||||||||||||||||||#|        #.         #        |#||||||||||||||||||||#|        #.
  ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||
  #       .#||||||||||||||||||||||||#|       #        #       .#||||||||||||||||||||||||#|       #        #       .#||||||||||||||||||||||||#|       #
 ||   ....|||#||||||##|#|||#|#||##||||....|. ||      ||   ....|||#||||||##|#|||#|#||##||||....|. ||      ||   ....|||#||||||##|#|||#|#||##||||....|. ||
 #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#      #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#      #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#
 #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.     #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.     #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.
.|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||    .|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||    .|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||
||   |....  #. ....|#.      |. ...|. ....||   ||    ||   |....  #. ....|#.      |. ...|. ....||   ||    ||   |....  #. ....|#.      |. ...|. ....||   ||
#.  .||||||##||||||##||####|||||||#||||||#|   .#    #.  .||||||##||||||##||####|||||||#||||||#|   .#    #.  .||||||##||||||##||####|||||||#||||||#|   .#
#    .||####|###########################|.     #    #    .||####|###########################|.     #    #    .||####|###########################|.     #
#      .#||||||.#.|| # |. ..# #| #|||||#|      #    #      .#||||||.#.|| # |. ..# #| #|||||#|      #    #      .#||||||.#.|| # |. ..# #| #|||||#|      #
#      .#|||||| ..  |# ## |#| ...#|#|||#|      #    #      .#|||||| ..  |# ## |#| ...#|#|||#|      #    #      .#|||||| ..  |# ## |#| ...#|#|||#|      #
#      .#|||#|# .# .#| #| ##|.#..#|||||#|      #    #      .#|||#|# .# .#| #| ##|.#..#|||||#|      #    #      .#|||#|# .# .#| #| ##|.#..#|||||#|      #
#      .#||||||############|######|||||#|      #    #      .#||||||############|######|||||#|      #    #      .#||||||############|######|||||#|      #
#   |...||#||||||#||||#|#||||||#|||||#||| |.|  #    #   |...||#||||||#||||#|#||||||#|||||#||| |.|  #    #   |...||#||||||#||||#|#||||||#|||||#||| |.|  #
#. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#    #. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#    #. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#
|| |  ...||  ...##| |  #| .|. |. #####  .. .| ||    || |  ...||  ...##| |  #| .|. |. #####  .. .| ||    || |  ...||  ...##| |  #| .|. |. #####  .. .| ||
|| ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||    || ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||    || ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||
.# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.    .# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.    .# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.
 #.|||||||#############################| ||| .#      #.|||||||#############################| ||| .#      #.|||||||#############################| ||| .#
 ||       ##||#||#||||||#||#||#||#||##.      ||      ||       ##||#||#||||||#||#||#||#||##.      ||      ||       ##||#||#||||||#||#||#||#||##.      ||
  #       .#|||||||||#||#|||||||||||#|       #        #       .#|||||||||#||#|||||||||||#|       #        #       .#|||||||||#||#|||||||||||#|       #
  ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||
  .#        |#||||||||||||||||||||#|        #.        .#        |#||||||||||||||||||||#|        #.        .#        |#||||||||||||||||||||#|        #.
   ||        |#||||||||||||||||||#|        ||          ||        |#||||||||||||||||||#|        ||          ||        |#||||||||||||||||||#|        ||
    #.        .######|#|#########|        .#            #.        .######|#|#########|        .#            #.        .######|#|#########|        .#
    .#.         |#####||||#####|         .#.            .#.         |#####||||#####|         .#.            .#.         |#####||||#####|         .#.
     |#           ||########||           #.              |#           ||########||           #.              |#           ||########||           #.
      |#             ......             #|                |#             ......             #|                |#             ......             #|
       |#.                            .#|                  |#.                            .#|                  |#.                            .#|
        |#.                          .#.                    |#.                          .#.                    |#.                          .#.
         .#|                        |#.                      .#|                        |#.                      .#|                        |#.
           |#|                    |#|                          |#|                    |#|                          |#|                    |#|
            .|#|.              .|#|.                            .|#|.              .|#|.                            .|#|.              .|#|.
               |##||.      .||##|                                  |##||.      .||##|                                  |##||.      .||##|
                 .||########||.                                      .||########||.                                      .||########||.

Scale With Search  2026  [scalewithsearch.com](https://scalewithsearch.com)
```
