html

HTTP Redirection Status Messages | Explained

HTTP status messages are sent to the user in response to the interaction between the web browser and the server. These messages are represented using a certain code along with a title describing the purpose of the message. Various categories of HTTP status messages are as follows.

  1. Information Status Messages (100, 101, 1xx)
  2. Successful Status Messages (200, 201, 2xx)
  3. Redirection Status Messages (300, 301, 3xx)
  4. Client Error Status Messages (400, 401, 4xx)
  5. Server Error Status Messages (500, 501, 5xx)

In this post, we are going to discuss various status messages that fall under the category of Redirection Status Messages.

What are HTTP Redirection Status Messages

The response messages that are sent by the server-side to redirect the client to a new location by providing the URL of that particular location are called the HTTP redirection status messages. These messages are assigned some codes starting from 300, 301, up to 3xx. Some of the status messages that fall under this group are explained below.

300 Multiple Choices

A response that consists of at least five multiple options and the user has to choose between those options. It is basically a list of links.

301 Moved Permanently

A response message that informs that the URL of the resource requested has been permanently changed and the message body consists of the new URL.

302 Found

A response message that informs that the URL of the resource requested has been temporarily changed and the message body consists of the new temporary URL. However, this new URL might change again in the future but until then this new URL should be used.

303 See Other

A response message that directs the client to another URL of the resource requested..

304 Not Modified

A response that informs the user that the resource requested has not been altered and the cached version of the resource can be used. This response is used as a result of caching.

306 Switch Proxy

A response message informing the user that the resource requested should be accessed using a proxy. However, due to security reasons, this response is no longer used.

307 Temporary Redirect

This is similar to the 302 Found response, which informs the user that the resource requested has been moved to another temporary URL. However, what makes it different is that it binds the user to use the same method for the second request which was used for the first request. For instance, if the TRACE method was used for the first request then the user must use this method for the second request.

308 Permanent Redirect

This is pretty much like the 301 Moved Permanently, which informs the user that the resource requested has been moved permanently to another URL. However, what makes it different is that it prohibits the user from using a method different from the initial method used for the request. For instance, if the PUT method was used for the first request then the user must use this method for the second request.

Conclusion

The response messages that are sent by the server-side to redirect the client to a new location are referred to as HTTP redirection status messages. Messages that lie under this group are 300 Multiple Choices, 308 Permanent Redirect, and so forth. These messages are assigned some codes starting from 300, 301, up to 3xx. All of these messages serve a different purpose which we have discussed in this write-up.

About the author

Naima Aftab

I am a software engineering professional with a profound interest in writing. I am pursuing technical writing as my full-time career and sharing my knowledge through my words.