More
More
308 Permanent Redirect
Like 301, but the client must repeat the same method and body.
- Code
308- Reason phrase
- Permanent Redirect
- Class
- 3xx Redirection
- Defined in
- RFC 9110 section 15.4.9
- Cacheable by default
- Yes
What it means
Redirection: the client has to take another step, usually following a Location header, to complete the request.
When a server should send it. For a permanent move where the method and body must be kept: an API endpoint or form handler that has a new home. For ordinary pages, 301 and 308 behave the same in browsers.
Common causes. An API endpoint that moved for good.
What to do. Update the address in your code.
How clients and crawlers treat it
Browsers and HTTP clients. Browsers follow it with the same method and body and cache it like a 301. Very old clients that predate RFC 7538 (2015) may not follow it.
Google Search. Treated the same as 301: a strong signal that the redirect target should be the canonical URL. Source: Google Search Central, How HTTP status codes, and network and DNS errors affect Google Search.
Caching. Cacheable by default (RFC 9110 section 15.1). With no Cache-Control or Expires header, a cache may still store it and reuse it for a heuristic period, often 10% of the time since Last-Modified, so set Cache-Control explicitly if that is not what you want.
Example response
HTTP/1.1 308 Permanent Redirect Location: https://api.example.com/v2/orders Permanent Redirect
How to send 308
location = /old-page {
return 308 https://example.com/new-page;
}
Redirect 308 /old-page https://example.com/new-page
header('Location: https://example.com/new-page', true, 308);
exit;
res.writeHead(308, { Location: 'https://example.com/new-page' });
res.end();
from flask import redirect
return redirect('https://example.com/new-page', code=308)
Change the paths to suit. In nginx, add_header needs always to apply to error responses.
Related codes
- 301Moved PermanentlyThe resource has a new permanent address, given in the Location header.
- 307Temporary RedirectLike 302, but the client must repeat the same method and body at the new address.
- 410GoneThe resource was deliberately removed and will not come back.
All status codes · All 3xx codes
Names and numbers from the IANA HTTP Status Code Registry. Google Search behaviour as documented by Google Search Central.