A web server sends a status code in the first line of HTTP response to indicate the status of a request received from a client. The status code contains three digits and referred as HTTP status code or HTTP error code. There are five groups of status codes categorized under 1xx, 2xx, 3xx, 4xx and 5xx indicating different HTTP response. 3xx HTTP status codes indicate a redirection that the user agent (a web browser or a crawler) needs to take further action when trying to access a particular resource.
Generally web server automatically forwards or redirects the user agent to another resource (URL) without interaction with the user. Since users don’t see the original requested URL, search engines will not index the original URL instead index the final redirected URL. So 3xx status codes have more important in search engine optimization compared to other set of status codes. In this article, let us explain all 3xx HTTP status codes for your reference.
List of 3xx HTTP Status Codes for Redirection
Below are the 3xx HTTP status codes:
- 300 – multiple choices
- 301 – resource moved permanently
- 302 – resource moved temporarily
- 303 – see another resource
- 304 – resource not modified
- 305 – Use proxy
- 307 – temporary edirection
- 306 & 308 codes
1. 300 – Multiple Choices
When a requested URL is pointing towards more than one resource then the user agent (web browser or crawler) will not be able to decide which page is to be fetched and the HTTP error code “300 – Multiple Choices “is received. In order to correct the 300 error code, check the HTTP headers or ensure the URL is pointing to only one resource so that a user agent can access the page successfully.
2. 301 – Resource Moved Permanently
A web server sends “301 – Moved Permanently” status code when there is a permanent redirect set to an original URL to forward the user agent to another URL. As the user can’t see the original URL, search engines will only index the redirected URL. Most of the popular search engine crawlers and user agents follow up to 5 redirects for a single URL. More than 5 redirects will results in an infinite loop and the browsers like Chrome will show a message like “Too Many Redirects”.
Learn more about 301 redirects.
3. 302 – Resource Moved Temporarily (or Found)
When a temporary redirect is set to an original URL to send the user agent to another URL then the server responds with a code “302 – Moved Temporarily”. Some browsers treat 303 code as equivalent to 302 code since 302 code is only used in HTTP/1.0.
4. 303 – See Another Resource
When a requested resource is located at another URL address and should be requested using a GET method then code “303 – See Another Resource” is received. The original requested page will be indexed by the search engines only when the 200 – Success code is received.
5. 304 – Resource Not Modified
If the requested resource is not modified since the last time of the request then server responds with “304 – Not Modified” code. In this case server assumes that there is no need to send the data again since the client already has the copy of the requested resource which is not modified. The last time of modification is mentioned in the request header line “If-Modified-Since” or “If-Match”.
If your page has not changed since the last time the search engine crawler accessed your site then returning of 304 code is recommended to speed up indexing and reduce the crawler load.
6. 305 – Use Proxy
If the requested resource can only be accessed through a proxy server then the web server responds with code “305 – Use Proxy”. The proxy server address is also received in the response which will be displayed in the browser window. Some browsers like Internet Explorer do not display this response properly due to security concern of displaying the proxy server.
7. 307 – Temporary Redirection
When the requested resource is moved temporarily to another address mentioned in the location header of the request then code “307 – Temporary Redirect” is received. This is only a temporary redirect but the next request will access the original URL. Only HTTP/1.1 protocol uses this status code.
8. 306 and 308 Status Codes
“306 – Switch proxy” HTTP status code indicates that the server should use the specified proxy for the following requests. Current HTTP protocols don’t use this status code.
308 is an experimental code indicating permanent redirect similar to 307 which is a temporary redirect. 307 and 308 codes are similar to 302 and 301 codes with the difference of not allowing the HTTP method to change.
Web server returns 3xx server response codes indicating the status of the request. Website owners use these codes for troubleshooting purposes to understand the status of the HTTP transaction. 301 is most popular out of all 3xx server response codes. The reason is simple that all webmasters should setup 301 redirects to retain the ranking of the pages in search engines.