3xx Redirection

HTTP 308 Permanent Redirect

The resource has been permanently moved to a new URL. The method must not change.

When is 308 used?

  • Permanent redirects that preserve POST method
  • RESTful API version migrations

How to handle a 308 response

Follow the Location header. Most HTTP clients do this automatically, and curl -L follows redirects on the command line. Update links and sitemaps that point at permanently redirected URLs.

Check the status code a URL returns from the command line:

curl -s -o /dev/null -w "%{http_code}\n" https://example.com

How to return 308 from your server

Node.js (Express)

res.status(308).json({ message: 'Permanent Redirect' });

Python (Flask)

return {"message": "Permanent Redirect"}, 308

Go (net/http)

w.WriteHeader(308)

Frequently Asked Questions

What does HTTP 308 mean?

308 Permanent Redirect: The resource has been permanently moved to a new URL. The method must not change.

Is 308 an error?

No. 308 is in the 3xx Redirection class. Redirection: the client must take additional action, usually requesting a different URL.