300–399 range

If you encounter a status code in this range, it means that the request is understood but extra steps are necessary to get to the actual content. The most common cases you will run into here are for redirection.

The 301, 302, 307, and 308 status codes all indicate that the resource you are looking for can be found at another location. In the header for this response, the server should indicate where the final location in the response header is. For example, a 301 response might look like this:

HTTP/1.1 301 Moved Permanently
Location: /blogs/index.html
Content-Length: 190

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<h1>301 Moved Permanently</h1>
Please go to <a href="/blogs/index.html">/blogs/index.html</a>
</body>
</html>

The server includes a Location header telling the client where the location of the resource was moved to, and that the client should send the next request to that location. The content here can be ignored in most cases.

Other status codes in this range are related to the use of proxies and cached information, both of which we will discuss in future chapters.