HTTP Status Codes

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

1

Common Cause

Permanent API endpoint URL changes

2

Common Cause

Form submission endpoint migration

3

Common Cause

Consolidating duplicate API routes permanently

4

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:

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.