Error Codes Wiki

HTTP 308 Permanent Redirect — Permanent Method-Preserving Redirect

Informational3xx redirection

About HTTP 308 Permanent Redirect

HTTP 308 Permanent Redirect permanently redirects to a new URI while preserving the HTTP method and request body, the permanent version of 307. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.

Here are the key things to understand: 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. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.

The most common reasons this occurs include: 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. Identifying the root cause is the first step toward finding the right solution.

To resolve this, follow these recommended steps: Use 308 in server config when permanently moving endpoints that handle POST/PUT. For Apache: Redirect 308 /old-api /new-api in .htaccess. For Nginx: return 308 https://newdomain.com$request_uri;. Test thoroughly — not all older HTTP clients support 308. Verify with curl -X POST -d 'test' -v to confirm method preservation. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.

This article is part of our HTTP Status Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.

Quick Answer

When should I use 308 vs 301?

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

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.