308 Permanent Redirect
The target resource has been assigned a new permanent URI. The method MUST NOT be changed.
Usually happens because:
- ☑ Moving API endpoints (e.g. POST
- ☑ Standard secure domain updates requiring
🔍 Quick Checklist:
Meaning
The HTTP 308 Permanent Redirect redirection status code indicates that the target resource has been assigned a new permanent URI. Like 301 Moved Permanently, this redirect is cached by browsers. However, unlike 301, a 308 redirect guarantees that the HTTP request method and body payload will not be changed.
Root Causes
- Moving API endpoints (e.g. POST endpoints) permanently to newer URIs.
- Standard secure domain updates requiring request method preservation.
| Cause | Frequency |
|---|---|
| Moving API endpoints (e.g. POST | ⭐⭐⭐⭐⭐ |
| Standard secure domain updates requiring | ⭐⭐⭐⭐ |
Common Mistakes
- Using 301 instead of 308 for moving API endpoints (results in client requests dropping body payloads).
- Using 308 for temporary redirection (which results in client browsers caching the route permanently).
How to Fix
Framework-Specific Examples
Express permanent redirect preserving POST method.
app.post('/api/users', (req, res) => {
res.redirect(308, 'https://v2.api.com/users');
});Server Configuration Examples
Enforcing 308 redirects in server blocks.
return 308 https://v2.api.com$request_uri;Prevention
- Audit API redirections to ensure method compliance.
- Configure automated tests checking redirect codes for POST/PUT routes.
Frequently Asked Questions (FAQ)
Q: What is the difference between 301 and 308?
With 301, browsers may change the request method from POST to GET during redirect. With 308, the client MUST repeat the exact same request method (e.g. POST remains POST) and body payload.
Q: Is HTTP 308 cached?
Yes. Browsers cache 308 redirects permanently. The browser remembers the redirection and goes directly to the new URL on subsequent queries.
Q: Does 308 pass link juice / SEO PageRank?
Yes. Search engines treat 308 exactly like 301 in terms of passing index PageRank equity to the new target URL.
Q: Which HTTP version introduced 308?
The 308 Permanent Redirect was introduced in RFC 7538 (published in 2015) to resolve the method-change ambiguity of 301.