Your Competitors Are Already Investing in SEO – Are You?

India’s Leading Digital Marketing Agency

What is 308 Status Code? Understanding Permanent Redirects

What is 308 Status Code?

Table of Contents

Reading Time: 2 minutes

HTTP status codes are essential for communication between browsers and servers. Among these, 3xx status codes handle redirects, guiding users from one URL to another.

While most people know 301 and 302 redirects, there’s another powerful yet lesser-known redirect: the 308 status code. Unlike temporary redirects, 308 is a permanent redirect that preserves the HTTP request method, making it crucial for certain use cases.

What is 308 Status Code?

The HTTP 308 status code indicates a permanent redirect, meaning the resource has permanently moved to a new URL. The important distinction is that the HTTP request method (GET, POST, etc.) and body are preserved, unlike a standard 301 redirect.

Key points:

  • Permanent redirect
  • Preserves HTTP request method and body
  • Ideal for form submissions, API endpoints, or URLs that will never return

308 Status Code vs 301 Status Code

Both 301 and 308 are permanent redirects, but here’s the difference:

Feature301 Redirect308 Redirect
Permanent or TemporaryPermanentPermanent
Preserves HTTP methodNo (POST may become GET)Yes (method and body preserved)
Use caseGeneral URL changesCritical for forms or APIs needing method preservation

Example:
A user submits a POST form to /old-form that is permanently moved to /new-form:

  • 301 may convert POST to GET
  • 308 keeps it as POST, ensuring submitted data isn’t lost

When is 308 Status Code Used?

Common scenarios include:

  1. Permanent URL changes where request method preservation is needed
  2. Form submissions or APIs that require the method to remain intact
  3. Replacing 301 when method/data preservation is important

SEO Implications of 308

  • Since 308 is permanent, search engines treat it like a 301 and transfer link equity to the new URL.
  • Crawlers index the new URL while preserving the original method if necessary.
  • Best practice: Use 308 when you want permanent redirection without breaking forms or API calls.

How to Implement a 308 Redirect

Apache Example (in .htaccess):

Redirect 308 /old-page https://www.example.com/new-page

Nginx Example:

location /old-page {
    return 308 https://www.example.com/new-page;
}

JavaScript Example:

window.location.replace("https://www.example.com/new-page");

Conclusion

The 308 status code is a permanent redirect that preserves the HTTP request method. It’s ideal for forms, API endpoints, and permanent URL changes where data integrity matters. Using it correctly ensures SEO value is maintained while keeping user experience seamless.

Get In Touch