Error Codes Wiki

HTTP 308 Permanent Redirect — Permanent Method-Preserving Redirect

Informational3xx redirection

Overview

HTTP 308 Permanent Redirect permanently redirects to a new URI while preserving the HTTP method and request body, the permanent version of 307.

Key Details

  • 308 is the permanent equivalent of 307 — method and body are preserved
  • Unlike 301, a POST redirected with 308 stays as POST at the new URL
  • Browsers and clients should update bookmarks and links to the new URI
  • Search engines treat 308 as a permanent redirect and transfer link equity
  • Defined in RFC 7538 as a supplement to the original HTTP redirect codes

Common Causes

  • Permanently moving an API endpoint that receives POST/PUT/DELETE requests
  • Domain migration where non-GET requests must be preserved
  • Restructuring URL paths for APIs that handle multiple HTTP methods
  • Consolidating duplicate endpoints while maintaining method semantics

Steps

  1. 1Use 308 in server config when permanently moving endpoints that handle POST/PUT
  2. 2For Apache: Redirect 308 /old-api /new-api in .htaccess
  3. 3For Nginx: return 308 https://newdomain.com$request_uri;
  4. 4Test thoroughly — not all older HTTP clients support 308
  5. 5Verify with curl -X POST -d 'test' -v to confirm method preservation

Tags

http308permanent-redirectmethod-preservingapi-migration

More in 3xx Redirection

Frequently Asked Questions

Use 308 when non-GET methods must be preserved (API endpoints). Use 301 for simple page redirects where GET is sufficient.