The 302 Found status code indicates that the requested resource has been temporarily moved to a different URL. The browser should automatically redirect to the new location, but future requests should continue using the original URL.
? Key Concepts
Belongs to the 3xx Redirection class
Indicates a temporary redirect
Commonly used after form submissions
Browser follows the Location header
? Syntax / Theory
When a server responds with 302 Found, it must include a Location header pointing to the temporary URL.
? View Code Example
// HTTP response with 302 Found redirect
HTTP/1.1 302 Found
Location: https://example.com/new-page
? Code Example(s)
? View Code Example
// PHP temporary redirect using 302 Found
header("Location: /dashboard.php", true, 302);
exit();