Status code 307 - What does a Temporary Redirect mean in HTTP?
One of the advantages that led to the choice of Hypertext Transfer Protocol (HTTP) for transmitting content such as web pages is the logging of communication between servers and clients through HTTP status codes. These are unique messages that report the current state of a request, provide more information about its processing, or report an error. The 307 Temporary Redirect status code is a commonly used 300 status code, allowing the temporary redirection of an address to another resource with identical or different content.
What is an HTTP status code?
The HTTP protocol primarily uses the status code for a server to inform a client of the outcome of an operation or request. Additionally, it allows for the transmission of additional information that is helpful for network analysis or enables the successful establishment of a connection. To maintain a clear order, there are five official classes for status codes, each capable of displaying 100 different states:
- 100 status code provides information about the connection and request
- 200 status code indicates successful processing or response
- 300 status code indicates a redirection to another instance
- 400 status code indicates a serious error caused by the client or the request
- 500 status code represents an error in processing on the server
In addition to these officially documented messages established in numerous public Request for Comments (RFC), there is also another unregulated numerical range with the 900 status code. Programmers and software companies use this to define custom control signals tailored to their applications.
How does a 300 status code work?
A 300 status code, unlike others, does not simply provide information about a fixed or achieved state, but rather initiates a direct intervention in the ongoing connection. Typically, it involves a redirection, which, like the 307 Temporary Redirect status code, either indicates a temporary redirection or, with status code 301 Moved Permanently, a permanent, definitive reference to a new instance. For this purpose, the header includes the Location field, through which the alternative address is passed and subsequently accessed by a client such as a browser. The redirection occurs without user interaction, making a 300 status code one of the "hidden" messages that are only displayed through explicit analysis of network traffic.
In addition to its practical function of directly redirecting to another instance, a 300 status code also impacts Search Engine Optimisation (SEO). For example, a status code 301 Moved Permanently leads to a reference to the new address instead of the old one, which operators like Google remove from their existing index and database. As a status code 307 Temporary Redirect typically involves a temporary, usually short-term redirection, such as during maintenance or a move to another web hosting, dedicated, or virtual server, the original address remains valid.
What is the difference between status code 307 and status code 302?
In its function, the status code 307 Temporary Redirect closely resembles the originally intended status code 302 Found (Moved Temporarily), but differs in some very important details. The code 302 fell out of favour because it could easily, albeit unintentionally or with criminal intent, cause an unauthorised redirection of popular websites to a foreign webpage (URL hijacking). To eliminate this risk, the HTTP protocol introduced the status code 307 Temporary Redirect in its first extension, Version 1.1 in 1999, where a redirection occurs but the original address retains its current value without restriction.
A second, more technical difference between the status code 307 Temporary Redirect and status code 302 Found (Moved Temporarily) lies in the way HTTP passes additional data. Here, the status code 307 uses the original method - a POST request is followed by another POST request, and a GET request remains as a GET request, while the status code 302 typically transforms any request into a GET request. Due to its specific features, it is advisable to always prefer the more current and secure status code 307 Temporary Redirect or the status code 301 Moved Permanently for a temporary redirection, unless there are specific reasons or intentions against it.
Photo: Free-Photos on Pixabay
Write a comment
- HTTP
- Fehlercodes
Tags for this article
More web hosts
More interesting articles
Too Many Requests - what is error 429 and how does it occur?
Too Many Requests is not a popular error. We tell you how you can avoid it.
11 Tricks for your htaccess file - this is how the htaccess works
We show you 11 tricks and hacks on how you can get the most out of your htaccess file.
What is the robots.txt file and how does it work?
We show you what you can do with the robots.txt file to prevent search engines and other bots from indexing.
HTTP Error 403: Forbidden - what is the solution?
HTTP Error 403: Forbidden - this is how you can solve the error.
HTTP Error 400: Where are the causes and the solution?
HTTP Error 400: We show you how you can fix the error.
HTTP Error Service Unavailable 503: Causes and Solutions of Error 503
We explain the server error 503 including approaches to solutions. We are here to help!