HTTP 301 vs 308 — Permanent Redirect & Method Preservation Comparison

http 301 vs 308: both are permanent redirects, but 308 strictly preserves the request method (POST stays POST). When to choose each for APIs vs web pages.

3xx

301

Moved Permanently

View full 301 page →

3xx

308

Permanent Redirect

View full 308 page →

Quick Cheat Sheet

Aspect 301 Moved Permanently 308 Permanent Redirect
Permanence Permanent Permanent
Method preservation MAY change POST → GET MUST preserve method
RFC 9110 (originally 1945) 7538 (2015)
Body preservation MAY drop MUST preserve
Browser support Universal Universal (modern), buggy in old IE

Why Both Exist

301 has been around since HTTP/1.0 and carries 30+ years of buggy implementations. The most consequential bug: many clients silently change POST to GET when following a 301, even though the original spec didn't allow this.

308 Permanent Redirect (RFC 7538) was specifically introduced in 2015 to fix this. It is a strict permanent redirect that MUST NOT change the request method or body.

When to Choose 308 Over 301

Use 308 when:

  • The redirect is for an API endpoint that accepts POST/PUT/PATCH/DELETE
  • You're moving a form submission URL (e.g., POST /v1/usersPOST /v2/users)
  • You need guaranteed body and header preservation across the redirect

Use 301 when:

  • The redirect is for HTML pages, GET-only resources (most web traffic)
  • Maximum compatibility with old user agents matters
  • You want SEO link equity transfer (both 301 and 308 transfer it, but 301 is more battle-tested in Google's eyes)

SEO: A Common Question

Google has confirmed both 301 and 308 transfer link equity equivalently for permanent redirects since 2016. There's no SEO penalty for 308. For browser-facing pages where method preservation isn't an issue, either works — most sites still use 301 for tradition and broader CDN/edge support.

Caching

Both are heuristically cacheable by default and treated as long-lived by browsers. Be careful — a wrong 308 is just as sticky as a wrong 301.

Real-World API Example

Suppose you've moved POST /api/v1/payments to POST /api/v2/payments:

  • With 301, some HTTP clients will retry as GET /api/v2/payments, which fails — the payment never goes through, but the client thinks the redirect succeeded.
  • With 308, all compliant clients re-issue the original POST with the same body, and the call succeeds.

This is why API gateways and microservice meshes typically use 308 for versioned URL migrations.

Browser & Tooling Support

  • All modern browsers (Chrome, Firefox, Safari, Edge) handle 308 correctly.
  • Curl, wget, requests (Python), axios (Node), Go's net/http: all preserve method on 308.
  • Internet Explorer ≤ 11 doesn't fully understand 308 (treats it as 200, breaking the redirect). Only relevant if you support IE.

Real-World Use Case

When deprecating /api/v1/* in favor of /api/v2/*, configure 308 redirects so that integration partners' POST /api/v1/orders requests transparently become POST /api/v2/orders without code changes. For a marketing site that renamed /pricing to /plans, 301 is fine — it's GET-only, and browser/CDN compatibility is broadest.

Look Up Any Status Code

Browse all status codes →