ShareYourGroupShareYourGroupHTTP Codes and Headers

Redirects: 301, 302, 303, 307 and 308

Five codes send the browser to another address. They differ in two ways: is the move permanent, and does the method stay the same?

The five codes

CodeMoveAfter a POST, the next request is
301PermanentGET (the method may be changed, in practice it is)
302TemporaryGET
303Result is elsewhereGET, by design
307TemporaryPOST again, with the same body
308PermanentPOST again, with the same body

What the browsers really did

We sent a POST with the body hello to a local test server that answers with each redirect code and sends the browser to a page that reports the method and body it receives. The test was run in Chrome 157 and in WebKit (Playwright) with fetch:

Redirect codeChrome 157 sentWebKit sent
301GET without bodyGET without body
302GET without bodyGET without body
303GET without bodyGET without body
307POST with body helloPOST with body hello
308POST with body helloPOST with body hello

In both browsers 301, 302 and 303 turned the POST into a GET and dropped the body, and 307 and 308 kept the POST and the body. RFC 9110 says that for historical reasons a user agent may change the method from POST to GET after a 301 (and 302), and points to 308 for those who want the method kept.

A real response

GET /c/301 HTTP/1.1
Host: example.com

HTTP/1.1 301 Moved Permanently
Date: Sat, 14 Nov 2026 10:00:00 GMT
Content-Type: text/html; charset=utf-8
Location: /new-page
Content-Length: 11

<p>demo</p>

The Location header holds the new address. A relative address such as /new-page is allowed and is resolved against the address you asked for.

Which one to use

  1. Moving a page for good, plain links: 301 (or 308).
  2. Moving an API endpoint or form handler for good: 308, so that POST stays POST.
  3. A short-term detour, such as a maintenance or login page: 302 or 307.
  4. After a form was saved: 303, so a refresh cannot send the form again.
  5. http to https: 301 or 308, and also send the HSTS header on the https site.

Redirect loops

A page that redirects to itself, or two pages that redirect to each other, makes the browser give up after about twenty redirects with an error such as "too many redirects". The usual causes are a rule that forces https when a proxy already handles it, www and non-www rules that point at each other, and a cookie that is required to avoid the redirect but is blocked.

Do redirects hurt speed?

Each one adds a round trip. Link to the final address inside your own pages.

Does a 301 pass its ranking to the new page?

Search engines treat a 301 as a strong hint about which address to list. Do not rely on it for pages whose content differs from the old one.

Sources

  • RFC 9110 sections 15.4.2 to 15.4.9 (rfc-editor.org/rfc/rfc9110)

Read on 14 November 2026.

This is an independent guide. It is not connected with the IETF, IANA, any browser maker or any company named here. Meanings were checked against the RFC texts on 14 November 2026. Responses shown were recorded on 14 November 2026 from a small test server on the author's own computer.