HTTP status code lookup

302 Found: Temporary Redirects Explained

A 302 Found response means the resource is temporarily at another URL, given in the Location header. The client follows it this time but keeps using the original URL, and search engines usually keep the original URL in their index.

Use 302 when the original URL will come back or depends on the situation: sending a logged-out visitor to the login page, a maintenance page, an A/B test or routing by language.

302

Found

The resource is temporarily at a different URL. Future requests should still use the original URL.

Look up any other status code →

Common uses

  • Sending a visitor who isn't logged in from /account to /login?next=/account.
  • Pointing a short or campaign URL at a page that will change.
  • Showing a maintenance or sale page in place of a normal one for a few days.
  • Sending visitors to a language or country version based on their browser or location.

When another code fits better

  • The move is permanent: use 301, or 308 to keep the request method.
  • A POST must stay a POST with its body: use 307.
  • You're redirecting after a form submission to a results page: use 303 See Other, which always switches to GET.

Set up a 302 redirect

Next.js redirect() and NextResponse.redirect() send 307 by default, the temporary redirect that keeps the request method.

# nginx
location = /sale { return 302 /summer-sale; }

# Apache (.htaccess)
Redirect 302 /sale /summer-sale

// Express (302 is the default)
res.redirect("/summer-sale");

A 302 that should have been a 301

If a temporary redirect stays in place for months, Google may decide it's permanent and index the target URL. That's usually what the site wanted, but say so directly: when a move is permanent, use 301 or 308.

Frequently asked questions

Is a 302 redirect bad for SEO?

No, when the move really is temporary. The original URL keeps its place in search results. It becomes a problem only when a permanent move is set up as a 302 and the new URL takes longer to replace the old one.

Why does a POST become a GET after a 302?

Early browsers switched to GET when following 301 and 302, and the specification now allows it. Use 307 when the method and body must be sent again.

Is 302 Found the same as 302 Moved Temporarily?

Yes. HTTP/1.0 called it Moved Temporarily, and HTTP/1.1 renamed it Found. It's the same status code with the same meaning.

More http status code lookup guides

Open the full http status code lookup →

From the blog