307 Temporary Redirect
Temporary redirect that preserves the request method.
The request should be repeated with another URL, but future requests should still use the original URL.
What HTTP 307 Temporary Redirect Means
The request should be repeated with another URL, but future requests should still use the original URL.
Temporary redirect that preserves the request method.
Common Causes
- Temporary server maintenance
- Load balancing
- Temporary URL change
How to Fix It (For Visitors)
- Browser should automatically redirect
How to Fix It (For Developers/Admins)
- Use instead of 302 to preserve HTTP method
- Set Location header
Returning a 307 Temporary Redirect (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 307 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(307).json({ error: 'Temporary Redirect' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='Temporary Redirect'), 307
PHP
<?php
http_response_code(307);
header('Content-Type: application/json');
echo json_encode(['error' => 'Temporary Redirect']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 307 Temporary Redirect
Frequently Asked Questions
What does HTTP 307 Temporary Redirect mean?
Temporary redirect that preserves the request method. In short: The request should be repeated with another URL, but future requests should still use the original URL.
How should I handle an HTTP 307 Temporary Redirect response?
Use instead of 302 to preserve HTTP method. Set Location header.
Official Specification
The 307 Temporary Redirect status code is defined in RFC 7231 Section 6.4.7.