SUBSCRIBE TO OUR BLOG

    The 308 Permanent Redirect code in an HTTP response means that a resource has been changed forever to a different URL. When a client encounters this 308 status, browsers automatically redirect to the new location while preserving the original HTTP request method. 

    Unlike other redirect codes, the 308 HTTP code ensures that if the original request was a POST method, it remains a POST method after redirection, making it more secure for handling sensitive data like form submissions or payment processes.

    What Causes the 308 Permanent Redirect?

    The 308 Permanent Redirect occurs when web administrators intentionally configure their servers to redirect traffic from an old URL to a new one. Common scenarios that trigger a status code 308 include:

    • Website restructuring, where content is moved to new directories
    • Domain migrations, where an entire website moves to a new domain
    • API endpoint changes where services need to maintain consistent request methods
    • Form submission handling where secure data transfer needs to be preserved
    • Content consolidation, where multiple pages are merged into a single resource

    The key distinction of HTTP code 308 is its ability to maintain the original request method, making it particularly valuable for scenarios involving secure data transmission.

    Example

    Request:

    HTTP/1.1 102 Processing
    
    POST /submit-order HTTP/1.1
    
    Host: oldshop.com
    
    Content-Type: application/json
    
    {
    
        "product_id": "12345",
    
        "quantity": 2
    
    }
    

    Response:

    HTTP/1.1 308 Permanent Redirect
    
    Location: https://newshop.com/submit-order
    
    Cache-Control: max-age=3600
    
    Content-Type: text/html

    The resource has been permanently moved to https://newshop.com/submit-order

    In this example, when a customer submits an order on oldshop.com, the server returns a 308 Permanent Redirect response. The browser automatically forwards the same POST request to newshop.com, preserving the original order data and ensuring a secure transaction process. This maintains data integrity while seamlessly directing users to the new domain.

    Reseller Club Hosting Services

    Reseller Hosting | Windows Reseller Hosting | Cloud Hosting | VPS Hosting | Managed VPS Hosting | Dedicated Server Hosting | Windows Dedicated Server | Managed Dedicated Server | Linux Shared Hosting | Windows Shared Hosting