When you see this status
- User logs in and is redirected to dashboard
- Website temporarily moved to a new domain
- API endpoint relocated for maintenance
Common causes
- Temporary URL changes for A/B testing
- Maintenance pages or site migrations
- Authentication redirects after login
How to debug it
- Verify Location header contains correct URI
- Check if client follows redirects automatically
- Inspect browser/network tab for redirect chain
- Ensure cache headers don't prevent redirection
Return this code in your framework
Express (Node.js)
res.redirect(302, 'https://example.com/new-location');
FastAPI (Python)
from fastapi import Response
return Response(status_code=302, headers={"Location": "https://example.com/new-location"})
NestJS
@Get()
@Redirect('https://example.com/new-location', 302)
getRedirect() { return null; }
Go (net/http)
http.Redirect(w, r, "https://example.com/new-location", http.StatusFound)
About HTTP 302
HTTP status code 302 Found is part of the
3xx Redirection family. Resource temporarily moved to a different URI, client should use original URI next time. Understanding it is essential for
backend engineers, API designers, and anyone debugging integrations between services.
The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance:
what triggers them, how to debug them in production, and exactly how to return them from common
frameworks. Each code page is hand-curated and verified.