pingrobot

HTTP status codes / 308

308 Permanent Redirect — HTTP Status Code

· 3 min read

Short answer

308 Permanent Redirect means the resource has a new permanent URL, and clients must repeat the request there without changing the method or body. It is the method-preserving version of 301, so a POST to a moved API endpoint arrives at the new address as a POST. It is newer than the other redirect codes, defined first in 2014.

308 Permanent Redirect says a resource has moved to a new URL for good, and that the client must send the same request there: same method, same body. It is what you want when an API endpoint or a form handler moves, because a POST to the old address still arrives as a POST at the new one.

What 308 means

RFC 9110 (Section 15.4.9) defines 308 as the target resource having been assigned a new permanent URI, with future references expected to use the URI the server provides in Location. The code was introduced in RFC 7538 in 2014 and is now part of RFC 9110, which notes that because it is so much younger than the other redirect codes, some clients might not recognize it.

The definition reads almost exactly like 301. The difference comes from the 3xx history in RFC 9110: 301 and 302 were allowed to turn a POST into a GET because early browsers did it, and 307 and 308 were added to "unambiguously indicate method-preserving redirects." So:

Method may change Method must stay the same
Permanent 301 Moved Permanently 308 Permanent Redirect
Temporary 302 Found 307 Temporary Redirect

Like 301, a 308 is heuristically cacheable. Browsers and proxies may store it and go straight to the new URL next time.

When you see it

  • API versioning and domain moves. api.example.com/v1/charge moved to payments.example.com/v1/charge, and existing integrations still POST to the old address.
  • Frameworks and hosting platforms. Next.js, for example, uses 308 for redirects marked as permanent, and some hosting platforms use it for trailing-slash normalization.
  • Webhook endpoints that moved. Senders that follow redirects can keep delivering payloads intact.
  • Git hosting and package registries that renamed repositories or paths and need clients' writes to keep working.

Before switching from 301 to 308

  1. Check your clients. Browsers and maintained libraries handle 308. Old embedded HTTP clients, legacy scripts and some scrapers may not; if they treat an unknown 3xx without following it, they fail.
  2. Remember the body travels twice. The client sends the body to the old URL, receives 308, then sends it again. Update integrations to call the new URL directly so the redirect is only a safety net.
  3. Credentials across hosts. RFC 9110 advises clients to reconsider sending headers such as Authorization and Cookie when following a redirect. If the new URL is on another host, authenticated API calls may fail after the redirect even though the request arrives.
  4. Do not stack redirects. HTTP to HTTPS followed by old path to new path is two hops. Redirect directly to the final URL in one step.
  5. Caching makes mistakes sticky. A wrong 308 can persist in browsers. Test with a 307 first if you are unsure.

SEO notes

For search, 308 and 301 are equivalent in Google's documentation: both are permanent redirects and a strong canonical signal for the destination. Choose between them based on whether you need methods preserved, not on search rankings.

How to check it

curl -I https://api.example.com/v1/charge
HTTP/2 308
location: https://payments.example.com/v1/charge

To check the method survives, follow the redirect with a POST body and compare the request lines:

curl -sv -L -o /dev/null -d '{"amount":100}' -H "Content-Type: application/json" \
  https://api.example.com/v1/charge 2>&1 | grep -E "^> (POST|GET) "

Both requests should show > POST. Use a test or sandbox endpoint, since this repeats a real write.

What it means for uptime monitoring

PingRobot's checker sends a GET, follows redirects, and judges only the final response, counting 200 to 399 as up. For a GET, a 308 and a 301 behave identically: the monitor reports whatever the new URL returns.

So a 308 that points to a working endpoint is up, and one that points to a missing route reports 404 or 405. A loop between old and new URLs never produces a final response, and the check fails with an error.

After a permanent move, update monitors to the new URL. Checking the destination directly measures the service itself. Keep a separate monitor on the old URL only if old integrations depend on the redirect continuing to work.

Start monitoring free — 10 monitors, no credit card.

Frequently asked questions

Is 308 better than 301?

Neither is better in general. For pages reached by normal links, which are GET requests, they act the same. 308 matters when POST, PUT or other requests with a body must survive the redirect, which is typical for APIs.

Do all clients support 308?

Current browsers and common HTTP libraries do. RFC 9110 notes that 308 is younger than its siblings and might not be recognized everywhere, so very old clients or embedded devices may treat it as an unknown 3xx.

Is 308 cached like 301?

Yes. RFC 9110 marks both as heuristically cacheable, so browsers may remember the redirect without asking the server again. Send Cache-Control if you want to limit that.

How does Google treat a 308?

Google's Search Central documentation groups 308 with 301 as a permanent redirect, a strong signal that the new URL should be the one shown in results.