Skip to content

Glossary 302 Redirect

What is a 302 redirect?

Definition

A 302 redirect is the HTTP status code that sends a visitor to another address while stating that the diversion is temporary, so the source URL remains the reference and the search engine keeps showing it in its results for as long as the redirect is in place.

On this page 5
  1. What a 302 redirect means
  2. How Google treats it
  3. Why it matters
  4. Good practice
  5. Common mistakes
In brief

How it differs from a 307, what really happens when a temporary redirect is left in place for months, and why maintenance, country detection and A/B tests are not all three solved with the same code.

What a 302 redirect means

The 302 code states that the requested resource is temporarily at another address and that the original one remains the valid reference. The specification puts it plainly: the client should keep using the source URL for future requests, because the diversion may disappear at any moment. That is the whole distance to the 301, which declares the move final.

There is a second temporary code that almost nobody uses and that is the right one in certain cases: the 307. The difference has nothing to do with the search engine and everything to do with the request method. For historical reasons, a browser may turn a POST request that receives a 302 into a GET, meaning it can arrive at the target having lost the data it carried. The 307 forbids that method change explicitly. On a normal page, requested with GET, both codes behave the same way and Google treats them the same way. On a form, at a payment gateway or at an API endpoint, that same difference decides whether the request arrives whole or arrives empty.

How Google treats it

Googlebot follows the redirect and reaches the target, but the indexing pipeline does not use it as a signal that this target should become the canonical version. The visible result is the one almost everyone expects: search results keep showing the source URL for as long as the diversion is active.

What usually gets misread is the reach of that rule. The fact that a 302 does not count as a canonicalisation signal does not make it a protection. The documentation adds a sentence that changes the picture: the target page may still end up indexed if other canonicalisation signals are present. Those signals are the usual ones, and none of them depends on the status code: internal links pointing at the target, its presence in the sitemap, a canonical tag, or simply the fact that both pages carry almost the same content.

From there comes the answer to the most common case, the 302 that has been in place for months. Google does not turn it permanent through age, and there is no published deadline after which its treatment changes. What happens is simpler and less reassuring: the more time passes, the more signals the target accumulates, and at some point those signals can outweigh the absence of the signal the 302 never provided. Leaving a temporary diversion in place indefinitely freezes nothing, it only means giving up on deciding which of the two addresses should win.

curl -I https://example.com/page
HTTP/1.1 302 Found
Location: https://example.com/target

Why it matters

Three situations account for almost every problem.

Maintenance is the first. A page under work has not moved, it stays where it is and will be back in a few hours, so redirecting the visitor leaves the crawler with nothing to read at that address exactly when it comes by. For temporary unavailability the specification reserves a code of its own, the 503, defined for short overloads and scheduled maintenance, with a Retry-After header that indicates when a fresh request makes sense.

The second is country or language detection. Most of Google's crawls come from United States IP addresses, and the crawler sends no language preference in the Accept-Language header. A site that redirects automatically by IP ends up showing it the same version every time, and the rest go uncrawled. Google advises against that automatic redirect and proposes the opposite: hreflang annotations, every version reachable through its own URL, and a visible selector.

The third is the A/B test, and this is where the 302 fits without argument. Google recommends that code for the variants precisely because it keeps the original URL in the index while the experiment runs. The condition is to dismantle it afterwards: alternate URLs, test scripts and markup, all gone.

Good practice

  • Use a 302 only if the source URL is going to serve content again, and write down when. A temporary diversion with no expected date is a deferred decision, not a decision.
  • Choose 307 when the request cannot change method: forms, payment gateways and API endpoints.
  • Cover maintenance with 503 and a Retry-After header instead of a redirect, because the page has not moved, it is only closed for a while.
  • In A/B tests, pair the 302 with a canonical tag on the variant pointing at the original URL, and remove both when the experiment closes.
  • For country and language, offer a visible selector and hreflang annotations rather than redirecting by IP.
  • After every migration or template change, review the redirect inventory with your own crawl and check the code actually served, without trusting what the CMS panel displays.

Common mistakes

  • Assuming a 302 protects the position of the source URL. All it guarantees is that the diversion does not count as a signal in favour of the target.
  • Covering maintenance with a redirect instead of answering 503, leaving the address without content for the crawler on the very visit that mattered.
  • Redirecting automatically by visitor IP, with the result that Google always sees the same language version and the others are never crawled.
  • Using a 302 where the request carries data, without allowing for the fact that it can reach the target converted into a GET.
  • Finishing an A/B test and leaving the test URLs, the redirect and the experiment markup in place.
Manuel Riveiro Rodriguez CEO & Digital Strategist

A technical audit covers this and everything else in one pass.

Request an audit

Frequently asked

How does a 302 redirect differ from a 307?

In the request method. A browser may turn a POST request that receives a 302 into a GET, whereas the 307 forbids that change explicitly. For a normal page both codes are equivalent and Google treats them the same way, so the difference only decides matters on forms, payments and API calls.

What happens if I leave a 302 redirect in place for months?

It does not become permanent through the passage of time, and no published deadline changes its treatment. What changes is the environment: the target accumulates links, sitemap entries and signals of its own, and those signals can lead Google to canonicalise on it despite the temporary nature of the diversion.

Does a 302 redirect pass authority to the target?

The code itself provides no signal in favour of the target, which is exactly what sets it apart from the 301. That does not stop the target from being indexed if other signals point at it. If the move is final, the 301 is the right tool, rather than waiting for the 302 to do that job.

Can I use a 302 redirect for the maintenance page?

Better not. A page under maintenance has not changed address, it is simply unavailable for a while. For that case the HTTP specification reserves the 503 code, defined for short overloads and scheduled maintenance, with a Retry-After header that indicates when it makes sense to request it again.

How do I check which code my redirect actually returns?

With a header request from the command line, for example curl -I against the old URL, reading the first line of the response together with the Location header. It is the only reliable check, because redirect plugin panels show what was configured and not what the server serves.

Sources

  1. Google classes 302 and 307 as temporary redirects, explains that Googlebot follows them but that the indexing pipeline does not use them as a signal that the target should be canonical, and adds that the target may still be indexed if other canonicalisation signals are present.
  2. The HTTP specification defines the 302 as a resource temporarily located at another address and warns that a client may change the method from POST to GET, which is why it recommends the 307 when that change is unacceptable; the same section defines the 503 for overload and scheduled maintenance.
  3. Google's A/B testing guide advises using a temporary redirect rather than a permanent one so that the search engine keeps the original URL in the index, and recommends removing alternate URLs, scripts and test markup as soon as the experiment ends.
  4. Google advises against automatically redirecting between language versions, notes that most of its crawls originate in the United States and that the crawler sends no Accept-Language header, and proposes hreflang annotations and visible links as the alternative.