302

Found

3xx Redirection

ELI5

Go somewhere else for now, but don’t assume this new address is the permanent one.

Server perspective

Use 302 for temporary redirects when you are comfortable with traditional redirect behavior and the original URI should remain the one clients keep using.

When to use

  • Return 302 for temporary page moves and lightweight browser redirects
  • Prefer 307 when method preservation matters, and 303 when you want the next request to be GET
  • Temporary redirects for GET or HEAD requests
  • Short-lived route changes such as experiments, campaigns, or temporary page moves
  • Cases where browser-style redirect behavior is acceptable

How to respond

  • Include a Location header with the temporary target URI
  • Keep the original URI valid for future requests because the redirect is not permanent

Headers to consider

  • Location
  • Cache-Control

Response body

  • A short explanatory body is optional, but the redirect target belongs in Location

Server-side pitfalls

  • Do not rely on 302 to preserve POST, PUT, or PATCH semantics across clients
  • Do not use 302 when the move is effectively permanent
  • Permanent redirects; use 301 or 308
  • Non-GET redirects where the original method and body must be preserved; use 307
  • Post/redirect/get flows where the follow-up request should intentionally become GET; use 303

Examples

Temporary campaign landing page

Request:GET https://api.example.test/pricing
Response:302 Found # Headers Location: https://api.example.test/spring-sale

The redirect is temporary, so the original URL remains the canonical entry point.

Short-term maintenance detour

Request:GET https://api.example.test/dashboard
Response:302 Found # Headers Location: https://api.example.test/status/maintenance

Users are redirected for now, but the application plans to restore the original route.

References

Related Status Codes