# HTTP redirect codes

> The five HTTP redirect codes differ on two things: permanent or temporary, and whether the request method is kept. Pick the right one with this table and config.

Canonical: https://scaplet.com/errors/http/http-redirect-codes

Guide Error · HTTP status codes

The five HTTP redirect codes differ on two things: permanent or temporary, and whether the request method is kept. Pick the right one with this table and config.

4 min

read

5

sources

Oct 22, 2026

updated

Scaplet Editorial Team

author

In one line

HTTP redirect codes are the 3xx responses that tell a client to fetch a different URL. Use 301 for a permanent move and 302 for a temporary one, where changing POST to GET is acceptable. Use 308 and 307 for the same two cases when the method must not change. Use 303 to send a POST's result to a page fetched with GET.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2Fhttp-redirect-codes%20(%22HTTP%20redirect%20codes%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2Fhttp-redirect-codes%20(%22HTTP%20redirect%20codes%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2Fhttp-redirect-codes%20(%22HTTP%20redirect%20codes%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2Fhttp-redirect-codes%20(%22HTTP%20redirect%20codes%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 4 minutes.

1. [The five redirect codes and when each applies 01](#the-five-redirect-codes-and-when-each-applies)
2. [Decision rule 02](#decision-rule)
3. [Set them up in nginx and Apache 03](#set-them-up-in-nginx-and-apache)
4. [Redirect problems to watch for 04](#redirect-problems-to-watch-for)
5. [What redirects do to SEO 05](#what-redirects-do-to-seo)

_01_Explained

## The five redirect codes and when each applies

RFC 9110 groups the 3xx class into several kinds of redirect. The ones that say a resource might be available at a different URI, given in the Location header, are 301, 302, 307 and 308. 303 redirects to a different resource that can represent an indirect response. 300 offers a choice among representations, and 304 points to a previously stored result. For moving a page, you choose among 301, 302, 307 and 308, and for the response to a form submission you often want 303.

Redirect codes at a glance
| Code | Name | Permanent? | Method | Use it for |
| [301](/errors/http/301) | Moved Permanently | Yes | A client may change POST to GET | Moving a page or site for good |
| [302](/errors/http/302) | Found | No | A client may change POST to GET | A temporary move where method change is fine |
| [303](/errors/http/303) | See Other | No | Follow-up is a GET or HEAD | Sending the user to a result page after a POST |
| [307](/errors/http/307) | [Temporary Redirect](/glossary/302-redirect) | No | Must not change | A temporary move that keeps POST as POST |
| [308](/errors/http/308) | [Permanent Redirect](/glossary/301-redirect) | Yes | Method preserved | A permanent move that keeps POST as POST |

The method column is where the codes really differ. RFC 9110 explains the history: 301 and 302 were originally method-preserving, but early user agents split on whether to redirect POST as POST or as GET, and "prevailing practice eventually converged on changing the method to GET." 307 and 308 were added to "unambiguously indicate method-preserving redirects". RFC 9110 also notes that 308 is younger than its siblings and "might not be recognized everywhere."

_02_Which code should I send?

## Decision rule

Situation

### Page or site moved for good, mostly GET traffic

Send

301

Situation

### Page or site moved for good, API clients that POST or PUT

Send

308

Situation

### Short-term move, such as a test or maintenance page

Send

302 or 307

Situation

### Short-term move for an API that POSTs

Send

307

Situation

### After a form POST, show a confirmation page

Send

303

Situation

### HTTP to [HTTPS](/glossary/https), domain changes, URL restructures

Send

301 (308 if you need to keep the method)

Reach for 307 and 308 when the request is a POST, PUT or DELETE that must keep its method at the new URL, which means APIs and form endpoints. RFC 9110 says user agents may change POST to GET after a 301 or 302.

_03_Check it

## Set them up in nginx and Apache

nginx's `return` directive takes a code and a URL, and its documentation says a redirect URL is accepted for the codes 301, 302, 303, 307 and 308. It also notes that nginx did not treat 308 as a redirect until version 1.13.0.

Apache's `Redirect` directive in mod_alias sends a temporary 302 when you give no status, and accepts `permanent` for 301. The Apache docs also say additional path information is appended to the target, and that "POSTs will be discarded" by this directive. It also accepts a numeric status, so a method-preserving redirect is possible, as in `Redirect 308`.

Apache mod_alias

```
Redirect permanent "/old-page" "https://example.com/new-page" Redirect "/temp" "https://example.com/elsewhere"
```

Permanent and temporary redirects

```
server { listen 80; server_name example.com www.example.com; return 301 https://example.com$request_uri; } location = /api/v1/orders { return 308 /api/v2/orders; } location = /sale { return 302 /spring-sale; }
```

_04_Worth knowing

## Redirect problems to watch for

### Chains

A to B to C wastes a round trip and risks loops. Point each old URL straight at the final one. See [redirect chains](/seo-issues/redirect-chains) and [redirect loops](/seo-issues/redirect-loops).

### Temporary codes left in place

A 302 that stays for years sends a temporary signal. See [temporary redirects](/seo-issues/temporary-redirects).

### Cross-origin API calls

A browser [CORS](/glossary/cors) request that gets redirected to another origin fails. See [Cross-Origin Request Blocked](/errors/misc/cross-origin-request-blocked).

### Credentials

RFC 9110 says that when following a redirect, a client should remove resource-specific header fields, including Referer, Origin, Authorization and Cookie, so don't count on them surviving a redirect.

_05_Explained

## What redirects do to SEO

Google's redirect documentation says permanent redirects show the new target in [search results](/glossary/serp), and temporary redirects show the source page. For 301 and 308, "[Googlebot](/ai-crawlers/googlebot) follows the redirect, and the indexing pipeline uses the redirect as a signal that the redirect target should be canonical." For 302, 303 and 307, the indexing pipeline doesn't use it as that signal. Google also lists a 0-second [meta refresh](/glossary/meta-refresh) as a permanent redirect type, and says to use JavaScript redirects only when server-side or meta refresh redirects aren't possible. Read the full [HTTP status code list](/errors/http/http-status-code-list) for the other 3xx codes, and the glossary entry [301 redirect](/glossary/301-redirect).

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ What is the difference between 301 and 308?

Both mean a permanent move. With 301 a client may change POST to GET for the next request. 308 requires the method to be preserved, but RFC 9110 says it might not be recognized everywhere.

_02_ What is HTTP return code 302?

302 Found says the resource temporarily resides at a different URI given in Location. A client may change a POST to GET on the redirected request, and 307 is the alternative when it must not.

_03_ Which code should I use for a POST that needs a redirect?

Use 307 for a temporary move or 308 for a permanent one when the method must be preserved. Use 303 when you want the client to fetch a result page with GET.

_04_ How do I create a redirect in HTML?

A meta refresh is the HTML option. Google treats a 0-second meta refresh as permanent and a longer delay as temporary, but prefers server-side redirects when you can set them.

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- rfc-editor.org
- iana.org
- nginx.org
- apache.org
- google.com

1. 01 [RFC 9110: HTTP Semantics, section 15.4 Redirection 3xx](https://www.rfc-editor.org/rfc/rfc9110#name-redirection-3xx) rfc-editor.org · checked 2026-10-25
2. 02 [IANA: HTTP Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) iana.org · checked 2026-10-25
3. 03 [nginx: ngx_http_rewrite_module (return)](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html) nginx.org · checked 2026-10-25
4. 04 [Apache HTTP Server: mod_alias (Redirect)](https://httpd.apache.org/docs/current/mod/mod_alias.html) httpd.apache.org · checked 2026-10-25
5. 05 [Google Search Central: Redirects and Google Search](https://developers.google.com/search/docs/crawling-indexing/301-redirects) developers.google.com · checked 2026-10-25

## Keep learning

[All errors](/errors)

[Learn HTTP 302 Found HTTP status codes](/errors/http/302) [Related Temporary redirects that should be permanent Redirects](/seo-issues/temporary-redirects) [Read next HTTP 301 Moved Permanently HTTP status codes](/errors/http/301) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in errors
[Cloudflare error 530](/errors/http/530) [5xx errors](/errors/http/5xx-errors)

More in HTTP status codes
[HTTP 308 Permanent Redirect](/errors/http/308) [HTTP 400 Bad Request](/errors/http/400) [HTTP 401 Unauthorized](/errors/http/401) [HTTP 405 Method Not Allowed](/errors/http/405) [HTTP 407 Proxy Authentication Required](/errors/http/407) [HTTP 408 Request Timeout](/errors/http/408) [HTTP 409 Conflict](/errors/http/409) [HTTP 412 Precondition Failed](/errors/http/412) [HTTP 431 Request Header Fields Too Large](/errors/http/431) [HTTP 499 Client Closed Request](/errors/http/499) [HTTP 500 Internal Server Error](/errors/http/500) [HTTP 501 Not Implemented](/errors/http/501) [HTTP redirect codes](/errors/http/http-redirect-codes) [HTTP status code list](/errors/http/http-status-code-list) [REST API status codes](/errors/http/rest-api-status-codes) [100 Continue](/errors/http/100) [101 Switching Protocols](/errors/http/101) [402 Payment Required](/errors/http/402) [403 Forbidden](/errors/http/403) [404 Not Found](/errors/http/404) [406 Not Acceptable](/errors/http/406) [411 Length Required](/errors/http/411) [413 Request Entity Too Large](/errors/http/413) [414 URI Too Long](/errors/http/414)

Terms on this page
[302 redirect](/glossary/302-redirect) [301 redirect](/glossary/301-redirect) [HTTPS](/glossary/https) [CORS](/glossary/cors) [SERP](/glossary/serp) [Meta refresh](/glossary/meta-refresh)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
