302 Found
Resource temporarily moved but may return to original URL.
The resource temporarily resides at a different URL.
What HTTP 302 Found Means
The resource temporarily resides at a different URL.
Resource temporarily moved but may return to original URL.
Common Causes
- Temporary redirect
- A/B testing
- Maintenance mode redirect
What Visitors Should Do
- Browser should automatically redirect
Notes for Developers
- Use 307 instead for temporary redirects that preserve method
- Set Location header
302 vs 301 vs 307 vs 308
| Code | Permanent? | Method on redirect | Typical use |
|---|---|---|---|
| 301 | Yes | May change POST to GET | Moved pages, domain or HTTPS migrations |
| 302 | No | May change POST to GET | Short-term moves, login redirects |
| 303 | No | Always GET | Redirect after a form POST |
| 307 | No | Must keep method and body | Temporary moves of APIs or forms |
| 308 | Yes | Must keep method and body | Permanent moves of APIs or forms |
RFC 9110 allows clients to switch a POST to GET on a 301 or 302 for historical reasons, which is why 307 and 308 exist.
Returning a 302 Found (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 302 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(302).json({ error: 'Found' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='Found'), 302
PHP
<?php
http_response_code(302);
header('Content-Type: application/json');
echo json_encode(['error' => 'Found']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 302 Found
Frequently Asked Questions
What does HTTP 302 Found mean?
Resource temporarily moved but may return to original URL. In short: The resource temporarily resides at a different URL.
How should I handle an HTTP 302 Found response?
Use 307 instead for temporary redirects that preserve method. Set Location header.
Official Specification
The 302 Found status code is defined in RFC 9110 Section 15.4.3.