iSocialWeb

302 Redirect

The temporary redirect and when it makes sense

A 302 redirect is a server response (HTTP status 302 Found) that sends the user to another URL temporarily, implying that the original address will be used again. That is why Google usually keeps the original URL indexed rather than the destination.

That is the difference that matters for SEO. According to Google's guide to redirects and Google Search, a permanent redirect is a strong signal that the destination should be the canonical URL, while a temporary one is only a weak signal. Picking the wrong status code will not break your site, but it can make Google show the URL you do not want.

302 and 307: the two temporary redirects

The 307 Temporary Redirect status is the 302's twin that preserves the HTTP method: if the original request was a POST (a form submission, for example), the browser repeats a POST at the new URL. With a 302, browsers may turn it into a GET. There is also 303 See Other, designed to send the user to a confirmation page after a POST.

Google treats 302, 303 and 307 as temporary and handles them the same way. If Chrome shows a 307 that your server does not send, it is usually the browser applying HSTS to force HTTPS: it is not a real server redirect and Googlebot never sees it.

301 vs 302 redirect: the differences

Aspect 301 (and 308) 302 (and 307)
Nature Permanent Temporary
Method-preserving version 308 307
URL Google usually indexes The destination The original
Canonicalization signal Strong Weak
Browser cache Cached by default, hard to undo Not cached unless cache headers say so
Typical use URL, domain or HTTPS change Tests, maintenance, promotions

The cache row has practical consequences: if you set a 301 redirect by mistake, browsers that already received it will remember it even after you remove it from the server. So when you are not sure a change is final, it is safer to start with a 302 and switch to a 301 once it is confirmed.

When to use a 302 redirect

A/B tests on separate URLs

If a test sends part of the traffic to a variant on a different URL, Google recommends a 302 rather than a 301 in its guide to website testing, so the original URL stays indexed. Remove the redirect once the test ends.

Temporarily out-of-stock products

Ideally, keep the product page live with an out-of-stock notice and alternatives, because it keeps its position and gives the user useful information. If you still need to redirect until stock returns, use a 302 to the category: the original product page remains the one Google has indexed.

Maintenance

To close a specific section for a few days, a 302 to a notice page works. If the whole site goes down, Google recommends returning a 503 (service unavailable) instead of redirecting, so it understands the outage is temporary and comes back to crawl later.

Language or country selection

Redirecting the root to /es/ or /en/ based on browser language or IP is a typical 302 use, because the destination depends on who is visiting. Keep in mind that Googlebot crawls mostly from the United States: every version must be reachable without a forced redirect and linked with hreflang, or Google will only see one of them.

Other legitimate uses

  • Promotions or campaigns with an end date that temporarily take over a URL.
  • Sending the user to log in and then back to the page they requested.
  • Tracking links that pass through an intermediate URL before the destination.

The mistake of leaving a 302 on a permanent move

It is one of the most frequent findings in technical SEO audits, and it is rarely a conscious choice: many tools return a 302 unless you say otherwise.

  • On Apache, the Redirect directive without a status code is temporary (302).
  • On nginx, rewrite ... redirect returns a 302; for a permanent one you need permanent or return 301.
  • In PHP, sending only a Location header produces a 302.
  • In Express, res.redirect() without a status code is also a 302.

The result is that Google keeps showing the old URL, the new one takes longer to consolidate and signals end up split. Google has said that a long-lived 302 may eventually be treated as permanent, but it is a weak signal and you cannot know when it will happen. Do not leave it to chance.

To fix it:

  1. List your site's redirects with a crawler, or run suspicious URLs through the redirect checker, which shows the status code of every hop.
  2. Switch to 301 every redirect that reflects a permanent change.
  3. Update internal links and the sitemap so they point straight to the final URL.
  4. Over the following weeks, use URL Inspection in Search Console to check which URL Google has chosen as canonical.

Frequently Asked Questions

  • When the original URL is coming back: an A/B test, a section closed for a few days, a time-limited promotion or a notice page. If the change is final (new URL, new domain, move to HTTPS), use a 301.

  • Google has said that 30x redirects do not lose PageRank. The difference between a 301 and a 302 is not about authority but about which URL Google picks as canonical: with a 302 it usually keeps the original.

  • Google may eventually treat it as permanent, but it is a weak signal and you do not control when that happens. In the meantime it may keep showing the old URL in results. If the change is final, switch it to a 301.

  • It is the version of the 302 that keeps the HTTP method of the request: a POST stays a POST. Google treats it as temporary, just like a 302. Chrome also shows an internal 307 when it forces HTTPS through HSTS, even if the server never sent one.