HTTP 308 Permanent Redirect — What It Means & How to Debug
HTTP 308 Permanent Redirect is like 301 but preserves the HTTP method and body — clients must resend the exact same request to the new URL permanently.
What It Means
The HTTP 308 Permanent Redirect status code is the method-preserving counterpart of 301 Moved Permanently. It tells the client that the resource has moved to a new URL permanently, and future requests should go directly to the new URL. Unlike 301, 308 guarantees the HTTP method and request body are preserved through the redirect.
When a server responds with 308, it includes a Location header pointing to the new canonical URL. Clients and search engines should update their records and use the new URL for all future requests. The redirect is cacheable by default, meaning browsers will remember it and skip the old URL entirely on subsequent requests.
This status code was introduced in RFC 7538 to solve the method-ambiguity problem of 301. A 301 redirect allowed user agents to change POST to GET — useful for browsers but problematic for APIs. The 308 code explicitly forbids this: the client must resend the identical request to the new location.
When It’s Sent
- API endpoint migration — moving a REST API from
/v1/to/v2/permanently while preserving POST/PUT - Permanent domain change — a company rebrands and all API endpoints move to a new domain
- Protocol upgrade — upgrading from HTTP to HTTPS with POST request preservation
- URL restructuring — permanently changing a resource path like
/old-path/resourceto/new-path/resource - Merged resources — two endpoints are consolidated into one, and the old endpoint permanently redirects
Real Example
curl -v -X PUT \
-H "Content-Type: application/json" \
-d '{"name":"Updated Resource"}' \
-L https://api.example.com/v1/resources/42Expected response:
> PUT /v1/resources/42 HTTP/1.1
> Host: api.example.com
> Content-Type: application/json
> Content-Length: 32
>
< HTTP/1.1 308 Permanent Redirect
< Location: https://api.example.com/v2/resources/42
< Content-Length: 0
<
* Issue another request to this URL:
* PUT https://api.example.com/v2/resources/42
> PUT /v2/resources/42 HTTP/1.1
> Host: api.example.com
> Content-Type: application/json
> Content-Length: 32
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 50
<
{"id":42,"name":"Updated Resource","version":"v2"}The client’s PUT method and JSON body are preserved in the redirected request. The 308 status makes it clear this is a permanent change — the client should update its configuration.
How to Debug
Browser DevTools
- Open the Network tab and enable Preserve log
- Make the request (using fetch or a tool that sends non-GET requests)
- Look for status
308in the request list - Check the
Locationheader in the response headers - Verify the redirected request uses the same method (PUT, POST, etc.)
- Confirm the request body appears in the redirected request’s payload
curl
# View the redirect without following it
curl -v -X PUT -d '{"data":"test"}' \
https://example.com/v1/items
# Follow the redirect to verify method preservation
curl -v -L -X PUT -d '{"data":"test"}' \
https://example.com/v1/itemsWith -L, curl follows the redirect and should reissue the same PUT request with the same body to the new URL. Without -L, only the redirect response is shown.
Postman
Disable automatic redirect following in Settings to inspect the 308 response and Location header. Re-enable and send the request — verify the method badge shows PUT (or whatever method you used) for both the original and redirected requests.
Common Causes
| Scenario | What Happens | Why It Matters |
|---|---|---|
| API version migration | /v1/ endpoints permanently redirect to /v2/ | Clients must update to the new version |
| Domain rebranding | All API calls redirect to new domain | Gradual migration without breaking existing clients |
| HTTP to HTTPS upgrade | HTTP requests get 308 to HTTPS | Ensures method preservation during upgrade |
| Path restructuring | /old-api/ resources move to /new-api/ | SEO and API client links are preserved |
| Service consolidation | Multiple endpoints merge into one | Old URLs permanently redirect to the unified endpoint |
FAQ
Related Codes
- HTTP 301 Moved Permanently — permanent redirect with potential method change
- HTTP 307 Temporary Redirect — temporary redirect with method preservation
- HTTP 302 Found — temporary redirect, may change method
- HTTP 404 Not Found — what happens when no redirect exists for a removed resource
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro