308 🌐 HTTP

HTTP 308 Permanent Redirect

A permanent redirect that, unlike 301, guarantees the method and body are kept.

Seen on: REST API

Meaning

308 tells clients and search engines the resource has moved for good, and that a POST must be re-sent as a POST. Next.js, Vercel and many CDNs use 308 for trailing-slash and https redirects.

Old clients may not understand 308, and a permanent redirect is cached by browsers — a mistaken 308 can keep sending users to the wrong URL even after you fix the server.

Common causes

  • Framework config (Next.js trailingSlash, redirects with permanent: true)
  • CDN/hosting enforcing https or a canonical domain
  • Mistaken permanent rule cached by browsers

⚡ Quick fix

  1. Point links and API clients at the final URL
  2. Use 307 while testing; switch to 308 when certain
  3. Clear the browser cache or test in a private window after changing a 308

Detailed fix by platform

Next.js

  1. bash
    // next.config.js
    module.exports = { async redirects() { return [{ source: '/old', destination: '/new', permanent: true }]; } };   // permanent: true → 308

curl

  1. curl -sIL https://example.com/docs | grep -iE '^(HTTP|location)'

How to diagnose

  1. Source — Which layer sends it (app, CDN, host)?
  2. Cache — Does it persist after you change config?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.