Free auditStart free
GuideError · HTTP status codes

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.

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 withChatGPTClaudePerplexityGoogleAI Mode
01Explained

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
CodeNamePermanent?MethodUse it for
301Moved PermanentlyYesA client may change POST to GETMoving a page or site for good
302FoundNoA client may change POST to GETA temporary move where method change is fine
303See OtherNoFollow-up is a GET or HEADSending the user to a result page after a POST
307Temporary RedirectNoMust not changeA temporary move that keeps POST as POST
308Permanent RedirectYesMethod preservedA 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."

02Which 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, 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.

03Check 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;
}
04Worth knowing

Redirect problems to watch for

Temporary codes left in place

A 302 that stays for years sends a temporary signal. See temporary redirects.

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.

05Explained

What redirects do to SEO

Google's redirect documentation says permanent redirects show the new target in search results, and temporary redirects show the source page. For 301 and 308, "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 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 for the other 3xx codes, and the glossary entry 301 redirect.
Questions

Asked a lot.

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

01What 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.

02What 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.

03Which 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.

04How 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. 01RFC 9110: HTTP Semantics, section 15.4 Redirection 3xxrfc-editor.org · checked 2026-10-25
  2. 02IANA: HTTP Status Code Registryiana.org · checked 2026-10-25
  3. 03nginx: ngx_http_rewrite_module (return)nginx.org · checked 2026-10-25
  4. 04Apache HTTP Server: mod_alias (Redirect)httpd.apache.org · checked 2026-10-25
  5. 05Google Search Central: Redirects and Google Searchdevelopers.google.com · checked 2026-10-25
Free · 2 minutes

Tools point. Agencies advise. This one ships.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane