308 as the method-preserving 301
MDN states that after a 308 the client sends the redirected request with the same method and body. A 301 has a looser rule: for historical reasons, RFC 9110 lets a client change a POST into a GET when it follows a 301. MDN therefore recommends 308 over 301 when the method must not change. Like 301, a 308 response is heuristically cacheable.
308 in Google and Next.js
Google's crawlers handle a 308 the same way as a 301. Google Search reads both 301 and 308 as a permanent move of a page to a new location. For site moves, Google recommends HTTP permanent redirects such as 301 and 308 where possible.
Next.js sends a 308 status code, not a 301, for redirects marked permanent. Checking which code each redirect returns is part of Next.js SEO optimization.
Client support, the 300 fallback and non-standard uses
Age. 308 dates from June 2014, much later than 301, 302 and 307, so some clients might not recognize it.
Fallback. A client that does not know 308 treats it as 300 Multiple Choices, so servers cannot rely on it redirecting automatically as with 301, 302 or 307.
Browser support. MDN's compatibility data records 308 support from Chrome 36, Edge 12, Firefox 14, Opera 24 and Safari 7. Internet Explorer supports it from version 11, but not below Windows 10. Mobile browsers have no entry of their own; the data marks them as mirroring the upstream browser.
Deployment rule. RFC 7538 restricts 308 to cases where the server is confident the client understands it, or where the 300 fallback is acceptable.
Typical use. MDN's example is reorganizing a website that has non-GET links or operations.
Non-standard use. Some applications use 308 in a non-standard way: Google Drive returns
308 Resume Incompletefor stalled resumable uploads.
If forms or API calls post to a URL that moves, test them in every browser you support as part of frontend development.
Sources
- RFC 9110: HTTP SemanticsIETF · rfc-editor.org
- RFC 7538: The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)IETF · rfc-editor.org
- 308 Permanent Redirect - HTTP | MDNMozilla (MDN) · developer.mozilla.org
- 301 Moved Permanently - HTTP | MDNMozilla (MDN) · developer.mozilla.org
- How HTTP status codes, and network and DNS errors affect Google SearchGoogle · developers.google.com
- Redirects and Google SearchGoogle · developers.google.com
- Site Moves and MigrationsGoogle · developers.google.com
- MDN browser-compat-data: http/status.json (http.status.308)MDN · raw.githubusercontent.com
- Redirections in HTTPMDN · developer.mozilla.org
- next.config.js: redirectsVercel (Next.js) · nextjs.org