Skip to main content
3xx Redirection

308 Permanent Redirect

The target resource has been assigned a new permanent URI. The client MUST preserve the original HTTP method and body.

Meaning & Description

The HTTP `308 Permanent Redirect` redirect status response code indicates that the resource requested has been definitively moved to the URL given by the `Location` headers.

The critical difference between a 308 and a 301 is that 308 guarantees that the HTTP method and body will not change when the client follows the redirect. If the original request was a `POST` with a JSON payload, the subsequent request to the new URL will also be a `POST` with the exact same JSON payload. It is the permanent counterpart to the `307 Temporary Redirect`.

Common Causes

  • Permanent API version migrations.
  • Webhook endpoint consolidations.
  • Domain migrations for services accepting write operations.

How to fix a 308 error

  1. Inspect the `Location` header to ensure it points to the correct new URL.
  2. Verify that the new endpoint is configured to accept the exact same HTTP method (e.g., POST) and payload structure as the old endpoint.
  3. Update your client code to point directly to the new URL to save the latency of the redirect on future requests.
  4. If you are dealing with very old HTTP clients (pre-2015), verify they support 308. If not, they may fail to follow the redirect.

Browser & SEO Behaviour

Browser Behavior

Browsers transparently follow the redirect while preserving the original request method and body. They also aggressively cache the 308 response, often skipping the original URL entirely on subsequent visits.

SEO Impact

Excellent for SEO. Just like a 301, Google passes link equity to the new URL and updates its index. Google officially treats 301 and 308 identically for SEO purposes.

CDN Behavior

CDNs will aggressively cache 308 responses if they are the result of a GET request. Caching behavior for POST-based 308s varies by CDN configuration.

Code Examples

Raw HTTP
HTTP/1.1 308 Permanent Redirect
Date: Mon, 12 Sep 2026 12:00:00 GMT
Location: https://api.example.com/v2/webhooks
Content-Length: 0
Node.js (Express)
app.post('/v1/webhooks', (req, res) => {
  // 308 ensures the webhook POST payload is sent to v2 permanently
  res.redirect(308, 'https://api.example.com/v2/webhooks');
});
Python (FastAPI)
from fastapi import FastAPI
from fastapi.responses import RedirectResponse

app = FastAPI()

@app.post("/v1/webhooks")
def v1_webhook():
    return RedirectResponse(url="https://api.example.com/v2/webhooks", status_code=308)
Go
func handler(w http.ResponseWriter, r *http.Request) {
    // 308 Permanent Redirect preserves the method and body
    http.Redirect(w, r, "https://api.example.com/v2/webhooks", http.StatusPermanentRedirect)
}
C# (ASP.NET Core)
[HttpPost("v1/webhooks")]
public IActionResult V1Webhook()
{
    // Returns a 308 Permanent Redirect
    return LocalRedirectPreserveMethod("/v2/webhooks");
}
curl
curl -X POST -d "data=123" -I -L http://example.com/api/v1/update

Raw HTTP Response Example

HTTP Response
HTTP/1.1 308 Permanent Redirect
Location: https://api.example.com/v2/webhooks
Content-Length: 0
Connection: close

Real-world Examples

Google Search Console: Google explicitly states that 308 and 301 redirects are treated the same for domain migrations and passing PageRank.
Stripe API Webhooks: Using 308s allows merchants to permanently move their webhook endpoints without dropping the JSON payload sent by Stripe.
Next.js: Uses 308 redirects by default when trailing slashes are enforced or when static redirects are configured in next.config.js.

Frequently Asked Questions

What is the exact difference between 308 Permanent Redirect and 301 Moved Permanently?

Historically, browsers changed POST requests to GET requests when following a 301. A 308 strictly forbids this behavior. It guarantees that if the original request was a POST, the redirected request will also be a POST.

When should I use 308 instead of 301?

Use 308 whenever you are redirecting an API endpoint or form submission that accepts POST, PUT, or DELETE requests. For standard web pages (GET requests), 301 and 308 are effectively identical, though 301 is older and more universally recognized.

Does Google treat 308 the same as 301 for SEO?

Yes. Google's John Mueller has explicitly confirmed that Googlebot treats 301 and 308 redirects identically for passing PageRank and updating the search index.

Are 308 redirects supported by all browsers?

Yes, all modern browsers support 308. However, if you are supporting legacy clients (like Internet Explorer 11 or very old mobile apps), they might not know how to handle a 308 status code.

How do I fix a cached 308 redirect?

Because 308s are heavily cached by browsers, fixing a mistake is difficult. You must either wait for the cache to expire (if headers were set) or set up a new redirect from the mistaken target back to the correct destination.

Did You Know?

The 308 status code was introduced in RFC 7538 in 2015, making it one of the newest standard HTTP status codes.

If a client doesn't understand the 308 status code, the HTTP specification requires it to treat it as a generic 300 response, which usually results in an error rather than following the redirect.

Developer Tips

  • For modern REST APIs, always use 308 instead of 301 for permanent endpoint migrations to prevent accidental payload drops.
  • If you are migrating a static website (HTML/CSS/JS only), 301 is still slightly preferred simply due to decades of established tooling, though 308 works just as well.
  • Always update your client application to use the new URL after receiving a 308 to avoid the performance penalty of the redirect.

Interview Questions

These are questions you might face in a backend or API design interview that touch on HTTP 308.

Why was the 308 status code introduced when 301 already existed?

Early web browsers broke the HTTP specification by changing POST requests to GET requests when following a 301 redirect. To fix this without breaking backwards compatibility on the web, 308 was introduced to explicitly guarantee that the HTTP method (e.g., POST) remains unchanged.

If you are permanently moving an API endpoint that handles file uploads (POST), which redirect code should you use?

You must use 308 Permanent Redirect. If you use a 301, the client might drop the file payload and switch to a GET request. A 308 ensures the client re-sends the POST payload to the new URL.

How do search engines handle 308 redirects?

Major search engines like Google treat 308 Permanent Redirects exactly the same as 301s. They pass link equity (PageRank) to the new URL and update their search index to point to the new destination.

Common Interview Mistakes

  • Thinking that 308 is unsupported or experimental (it has been standard since 2015 and is fully supported).
  • Failing to distinguish between 301 and 308 regarding HTTP method preservation.
  • Assuming that 308 redirects are not cached.