307 Temporary Redirect
The HTTP307 Temporary Redirectredirection response status code indicates that the resource requested has been temporarily moved to the URL in theLocation header.
A browser receiving this status will automatically request the resource at the URL in theLocation header, redirecting the user to the new page.Search engines receiving this response will not attribute links to the original URL to the new resource, meaning noSEO value is transferred to the new URL.
The method and the body of the original request are reused to perform the redirected request.In the cases where you want the request method to be changed toGET, use303 See Other instead.This is useful when you want to give an answer to a successfulPUT request that is not the uploaded resource, but a status monitor or confirmation message like "You have successfully uploaded XYZ".
The difference between307 and302 is that307 guarantees that the clientwill not change the request method and body when the redirected request is made.With302, older clients incorrectly changed the method toGET.307 and302 responses are identical when the request method isGET.
In this article
Status
307 Temporary RedirectExamples
>307 response to a moved resource
The followingGET request to is made to a resource that has a307 redirection in place.TheLocation header provides the URL of the redirected resource.
GET /en-US/docs/AJAX HTTP/2Host: developer.mozilla.orgUser-Agent: curl/8.6.0Accept: */*HTTP/2 307location: /en-US/docs/Learn_web_development/Core/Scripting/Network_requestscontent-type: text/plain; charset=utf-8date: Fri, 19 Jul 2024 12:57:17 GMTSpecifications
| Specification |
|---|
| HTTP Semantics> # status.307> |
See also
- Redirections in HTTP
- HTTP response status codes
302 Found, the equivalent to307, but may modify non-GETmethods303 See Other, temporary redirect that modifies the request method toGET301 Moved Permanently, a permanent redirect