308 Permanent Redirect
Permanently moved, and the method and body must be preserved.
What 308 means
308 is to 301 what 307 is to 302: the same permanence, without the method-rewriting ambiguity. Clients must follow it using the original method and body, and must update their stored references to the new URL.
It is the right choice for a permanent API endpoint move, or any permanent redirect where requests are not exclusively GETs. Redirecting a POST endpoint with 301 will, in practice, deliver a bodyless GET to the new location.
The only reason to prefer 301 is compatibility with very old clients that predate 308 (which was standardised in 2015) and may not recognise it. For browsers and modern HTTP libraries this is not a practical concern.
Like 301, it is cached aggressively - so verify the destination before publishing it.
Headers this status expects
- Location - the new permanent URL. Required.
Should a client retry?
Follow with the same method and body, and update stored references to the new URL.
FAQ
- 308 or 301?
- 308 if the request might not be a GET, because 301 is allowed to rewrite the method to GET and clients generally do, silently dropping the body. 301 only if you need to support clients older than 2015.
- Do search engines support 308?
- Yes - Google treats 308 equivalently to 301 for consolidating signals to the new URL. There is no SEO penalty for choosing it.
Often confused with
- 301 Moved Permanently The resource has permanently moved to the URL in the Location header.
- 307 Temporary Redirect Temporarily at a different URL, and the method and body must be preserved.