OOmnistu

Blog / Web Fundamentals

Web Fundamentals

HTTP redirects explained: 301, 302, 303, 307 and 308

Compare HTTP redirect statuses and consider method preservation, caching and migration behavior before choosing a redirect.

OOmnistu
Reviewed 2026-11-16 · 3 min read

An HTTP redirect such as 301, 302, 303, 307 or 308 uses a response status and a Location header giving the target URL. Not every 3xx response sends the browser to a different URL: 304 concerns cache revalidation. Browsers load the new URL at once; apart from one extra round trip, users rarely notice. This article summarises MDN's "Redirections in HTTP" page, read in full on 15 November 2026.

Permanent versus temporary

Code Kind Method handling (per MDN) Typical use
301 Moved Permanently permanent GET unchanged; other methods may become GET site reorganisation
308 Permanent Redirect permanent method and body unchanged reorganisation with non-GET operations
302 Found temporary GET unchanged; others may become GET page temporarily unavailable
303 See Other temporary GET stays GET; following POST, retrieve the result with GET redirect after PUT or POST so a refresh does not repeat the action
307 Temporary Redirect temporary method and body unchanged like 302, better when non-GET operations exist

MDN says permanent redirects imply the old URL should no longer be used, and crawlers and RSS readers update it. Crawlers do not memorise a temporary target. 308 and 307 were created because some clients changed the method on 301 and 302, against the specification's intent. Codes 300 and 304 are listed as special: 304 means a cached copy is still fresh.

Other ways to redirect

Use cases from the page

Apache example from the page

The mod_alias Redirect and RedirectMatch directives create 302 redirects by default. Redirect / https://www.example.com also redirects everything under the path. RedirectMatch takes a regular expression. Because the default is temporary, confirm the status you actually send.

Other servers and loops

For a site that changes URLs

  1. Map each old URL to its closest equivalent. Redirect only where an equivalent exists; the page does not say what to do when none exists.
  2. Choose 301 or 308 for a permanent move. For a temporary location choose 302 or method-preserving 307; use 303 when the intended next step is to retrieve a separate result after an operation.
  3. Update internal links to the new URLs.
  4. Avoid chains: fewer redirects, fewer round trips.

Limits

We make no claim about how long search engines take to process redirects, which this page does not state.

By Omnistu.

Sources

Previous
Website security basics for small businesses: the OWASP Top 10:2025 as a working checklist