308 308 Permanent Redirect
The resource has been permanently moved — preserve the HTTP method.
What Is This?
The HTTP 308 Permanent Redirect status code is the method-preserving equivalent of 301. Like 301, the redirect is permanent and search engines should update their indexes. Unlike 301, which may change POST to GET, 308 guarantees the HTTP method and body are preserved. It is ideal for permanent API endpoint migrations and form submission endpoints.
Common Causes & Solutions
Common Cause
Permanent API endpoint URL changes
Common Cause
Form submission endpoint migration
Common Cause
Consolidating duplicate API routes permanently
Use 308 for permanent API redirects
When permanently moving API endpoints, use 308 to ensure all HTTP methods are preserved.
// Nginx permanent redirect preserving method
location /api/v1/ {
return 308 /api/v2/$uri;
}
// Express.js
app.all('/api/v1/*', (req, res) => {
const newPath = req.originalUrl.replace('/v1/', '/v2/')
res.redirect(308, newPath)
})Related Entries
More from this reference:
301 301 Moved Permanently
The requested resource has been permanently moved to a new URL.
302 302 Found (Temporary Redirect)
The requested resource is temporarily located at a different URL.
304 304 Not Modified
The resource has not been modified since the last request, use the cached version.
307 307 Temporary Redirect
The resource is temporarily at a different URL — preserve the HTTP method.
Frequently Asked Questions
Should I use 301 or 308?
Use 301 for web pages (GET requests) where method preservation is irrelevant because browsers always use GET. Use 308 for API endpoints where POST, PUT, PATCH, and DELETE methods must be preserved during the redirect.
Is 308 widely supported?
308 is supported by all modern browsers and HTTP clients. Older clients (IE 11 and earlier) may not support it. For broad compatibility with legacy clients, consider handling method preservation on the server side instead of relying on 308.