BloggingBIG Logo
Search
  • Blogs
  • How we work
  • Write Guest Post
Get started

HTTP Status Code 308-PERMANENT REDIRECT

by Saurabh Chalise

  • 4 min read
    • HTTP Status
Share this content
HTTP Status Code 308-PERMANENT REDIRECT image

Navigation

  • What does HTTP Status Code 308-Permanent Redirect mean?
    • Examples 
    • Implementations
      • cURL
      • Nginx
  • Location Header Field
    •  Syntax
    • Example 
  • 301- Moved Permanently Vs 308-Permanent Redirect
  • Status
  • Specification
  • Browser compatibility
  • 308 Code References
  • Related Articles
  • FAQ
    • What does HTTP Status Code 308 mean?
    • What is the difference between Status Code 301 and 308?
  • Conclusion

What does HTTP Status Code 308-Permanent Redirect mean?

308-Permanent Redirect status code is one of the classes of 3xx(redirection) response code that indicates the resources which were requested by the client to the server, have been definitively transferred to the URL(Uniform Resource Locator). The URI is given by the Location Headers field.

For automated redirection, the user agent MAY utilize the Location field value. A brief hypertext remark with a hyperlink to the updated URI is generally included in the server’s response payload.

According to the RFC7538 specification paper for the 308 status code, the 308 Permanent Redirect code was added to the HTTP standard very recently in April 2015. The RFC specification stated that the 308 Permanent Redirect code was required to fill the void left by comparable codes 301, 302, and 307.

This page is redirected by the browser, and search engines’ links to the resource are updated.

In HTTP Status Code 308, the  target resource has been given a new permanent URI, and any future references to it should use one of the URIs provided.

Examples 

HTTP/1.1 308 Permanent Redirect
Location: https://bloggingbig.com/http/308-permanent-redirect
Server: Apache/2.4.29

Implementations

cURL

If the answer includes a Location header, cURL correctly handles 308 redirects by following general 300 semantics. It lacks an explicit method for rewriting or updating URL references. In cURL 7.24.0, a test for this status code was added.

Nginx

When you apply a rewrite rule with the permanent flag, Nginx will deliver a 308 Permanent Redirect:

# Redirect www.bloggingbig.com to bloggingbig.com
server {
listen 80;
server_name www.bloggingbig.com;

location / {
rewrite  ^(/.*)  https://bloggingbig.com$1  permanent;
}
}

Location Header Field

In some responses, the Location header field is used to refer to a particular resource in connection to the response.  The type of relationship is defined by the combination method of the request and status code semantics.

Location = URI-reference

It only provides a meaning when used with a 3xx (redirection) or 201 (created) status response.

 Syntax

Location:<url>

Example 

Location:/index.html

301- Moved Permanently Vs 308-Permanent Redirect

308 is somehow similar to 301.Both Status Code signals that the resource the user was attempting to access has relocated. The client should update any bookmarks from the old to the new URL in both situations. These statuses are also respected by search engines.

The distinction between 301 and 308 is that when a client sees a 308 redirect, they must make the identical request on the destination location. If the request was a POST with a body, the client must send a POST request to the new location with a body.

In the situation of 301, a customer has the option to do so. Most clients, in reality, do not do this and instead transform the POST request to a GET request.

The 308 is a very new protocol, and RFC7238 presently lists it as experimental. The majority of contemporary clients support it, while older clients may have difficulties.

Status

308 Permanent Redirect

Specification

The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect) (Permanent Redirect)# status.308

Browser compatibility

Credit: Mozilla.org

308 Code References

Symfony HTTP Status ConstantResponse::HTTP_PERMANENTLY_REDIRECT

Related Articles

HTTP Status Code 205 Reset Content
HTTP Status Code 300-Multiple Choices
HTTP Status Code 302 Found
HTTP Status Code 204 – No Content
HTTP Status Code 207 Multi-Status

FAQ

What does HTTP Status Code 308 mean?

308-Permanent Redirect status code is one of the classes of 3xx(redirection) response code that indicates the resources which were requested by the client to the server, have been definitively transferred to the URL(Uniform Resource Locator). 

What is the difference between Status Code 301 and 308?

The distinction between 301 and 308 is that when a client sees a 308 redirect, they must make the identical request on the destination location. If the request was a POST with a body, the client must send a POST request to the new location with a body.
In the situation of 301, a customer has the option to do so. Most clients, in reality, do not do this and instead transform the POST request to a GET request.
The 308 is a very new protocol, and RFC7238 presently lists it as experimental. The majority of contemporary clients support it, while older clients may have difficulties.

Credit: Web Dev Simplified
 

Conclusion

The new status code 308 specification recycles material from the HTTP/1.1 definitions of status codes 301 and 307.

I hope this article was able to help you with your doubts and queries related to the HTTP status code 308(Permanent Redirect). Still, if there are any queries related to this topic, feel free to ask in the comment section, we would be happy to assist you. Thank you.

Share
Tweet
Share
0 Shares
Saurabh Chalise image

Saurabh Chalise

Be first to comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

More from HTTP Status

HTTP Status Code 499 Client Closed Request image

HTTP Status Code 499 Client Closed Request

Kedar Dangal image

by Kedar Dangal

  • 4 min read
    • HTTP Status
HTTP Status Code 431 Request Header Fields Too Large image

HTTP Status Code 431 Request Header Fields Too Large

Kedar Dangal image

by Kedar Dangal

  • 4 min read
    • HTTP Status
HTTP Status Code 429-Too Many Request image

HTTP Status Code 429-Too Many Request

Saurabh Chalise image

by Saurabh Chalise

  • 4 min read
    • HTTP Status

Quick links

  • Siteground black friday deals
  • Wp engine black friday deals
  • Greengeeks black friday deals
  • Tmd hosting black friday deals
  • Fastcomet black friday deals
  • Hostwinds black friday deals
  • bluehost black friday
  • Namecheap black friday deals
  • Ionos 1 & 1 black friday deals
  • Hostgator black friday deals
  • ipage black friday deals
  • wpx hosting black friday deals
BloggingBIG logo
  • About
  • DISCLAIMER
  • Disclouser for Blogging BIG
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
Developed by Fnclick
Back To Top