What is a 3xx Response Code?
The 3xx HTTP status codes are a class of status codes that indicate that further action by you may be required to get to the destination URL. Redirect status codes are important to you because locations on the Internet are always changing, and sometimes the actions you take on the Internet may require a redirect to a new location. Using such codes, the web server and the user agent communicate to take you to other locations, either automatically - in mitigating errors or relocations, or basically - in responding to actionable requests. Below is the list of 3xx HTTP status codes.
- 300 - Multiple Choice
- 301 - Moved Permanently
- 302 - Found
- 303 - See Other
- 304 - Not Modified
- 305 - Use Proxy
- 306 - Switch Proxy
- 307 - Temporary Redirect
- 308 - Permanent Redirect
What does the 3xx Response Code Look Like?
A web server sends status codes in the first line of HTTP Response to indicate the status of request received from the client. 3xx status codes are reserved for redirection. Redirection indicates that a user agent may need to take further action for accessing the resource. A 301 Response may look like this-
Guide to 3xx Response Code-
Checkout the list of 3xx Response Code:
||Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
||This and all future requests should be directed to the given URI.
||Tell the client to look at (browse to) another URL.
||The response to the request can be found under another URI using the GET method. When received in response to a POST (or PUT/DELETE), the client should presume that the server has received the data and should issue a new GET request to the given URI.
||It indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.
||The requested resource is available only through a proxy, the address for which is provided in the response.
||No longer used. Originally meant "Subsequent requests should use the specified proxy."
||In this case, the request should be repeated with another URI; however, future requests should still use the original URI.
||The request and all future requests should be repeated using another URI.
How to troubleshoot 3xx response codes
301: Moved Permanently
301 Moved Permanently is an HTTP Response Code indicating that the requested resource has been moved permanently to a new location provided by Location response header. The Location header indicates the new location or we can say URL where requested resource can be found.
Most browsers should automatically detect the 301 Moved Permanently response code and should automatically process the redirection.
Here are some tips to troubleshoot this error on the server-side:
- Check the Server Configuration file.
- Check logs.
- Check Application code or Script Bugs.
302 Found is an HTTP response code indicating that the requested resource has been temporarily moved to a different URI. Since the current URI may change in the future, the client who receives this response code should continue to use the same old URI for future requests. It is to be noted that the 302 Found response code is used for completely different purposes than 301 Moved Permanently response code.
Here are some tips for troubleshooting on the server-side:
- Confirm your Server Configuration.
- Check for Outdated Software.
- Scour the logs.
- Debug your application code.
3xx series of response codes are entirely reserved for the purpose of redirection. 301 is the most popular out of all 3xx server response codes. The reason is quite simple: all webmasters should setup 301 redirects to retain the ranking of the pages in search engines.