Skip to content
SEO

301 vs 302 Redirect: Which One Should You Use for SEO?

By Published: 5 min read

301 and 302 redirect arrows

Choosing between a 301 vs 302 redirect comes down to one question: is the move permanent or temporary? A 301 (Moved Permanently) tells clients that the old URL now has a new permanent address. A 302 (Found) tells them the page is only temporarily somewhere else. For SEO, that difference matters because search engines read the code as a hint about which URL should stay the main one.

In short, use a 301 for permanent moves and a 302 only when the original URL should come back.

301 vs 302 redirect: what each code means

Both codes are HTTP redirect responses. The server sends the status code and a Location header that holds the new address. The difference is what the code says about the future. A 301 means the target has been given a new permanent address, and later requests should use it. A 302 means the resource is temporarily located under a different address.

Browsers send the visitor on in both cases, so the difference is not visible to the person clicking. It shows up in how clients, caches and search engines store and use the new address.

301 Moved Permanently 302 Found
Meaning New permanent address Temporarily at a different address
Typical use Permanent move Temporary change
Original URL expected back No Yes

A third code, 307 (Temporary Redirect), is also temporary but adds one rule. When a client follows it automatically, the client must not change the request method. A POST stays a POST. If you need that method rule on a permanent move, look up the exact rules in the HTTP specification before you choose a code.

301 vs 302 redirect for SEO: why the code matters

A search engine has to decide which of two URLs to show. A permanent redirect says the old address is retired, so the new URL is the natural one to keep. A temporary redirect says the old address is still the real one, so there is less reason to swap it out.

The practical result is that a 302 left on a permanent move can keep the old URL in play longer than you want. If you want the new URL to replace the old one, send a 301 and make the move final.

Decision guide: which redirect to use

Start with the reason for the change, then pick the code.

301 or 302 decision flowchart

Figure 1: Choosing a 301 or 302 redirect based on whether the move is permanent.

  1. Permanent URL or domain change. Use a 301. Examples: a store changes a product slug, or a site moves to a new domain. A permanent redirect also keeps existing links and bookmarks working.
  2. Temporary change where the original returns. Use a 302. Example: a short campaign page that should go back to the original URL afterward.
  3. A/B test or temporary variant. A 302 is usually the better fit, because the original URL remains the intended address. If the test runs for a long time or the variant becomes the final page, treat it as a permanent move and switch to a 301.
  4. Site down for maintenance. Do not use a redirect for this. A 503 (Service Unavailable) is the code RFC 9110 describes for temporary overload or scheduled maintenance.
  5. Old page with no equivalent replacement. Redirect only when there is an equivalent replacement page. Sending every removed page to the homepage does not meet that test.
  6. A 302 that is now a permanent move. Switch it to a 301 once the move is final.

The same logic applies to APIs. If an endpoint is temporarily served from another address, a 302 fits. If the endpoint has moved for good, a 301 fits.

Common redirect mistakes

Mistake Why it hurts Fix
Using a 302 for a permanent move The code says the original URL will return, which is not true Use a 301
Redirect loop, where A sends to B and B sends back to A A loop happens when a redirect leads back to a URL that was already followed, so the page never loads Trace each hop and point the chain at one final URL

Redirect chains and how long to keep redirects

A chain is a redirect that points to another redirect, such as A to B to C. Each hop adds latency for the visitor. If B later moves to C, change A so it points straight to C, and test with curl -IL that the target is reached in a single hop.

Keep a permanent redirect in place for a long time, for as long as old links or bookmarks may still point to the old URL. During a move, also change internal links from the old URLs to the new ones, so your own pages do not depend on the redirect.

How to check a redirect before you go live

  1. Check the status code and the Location header: curl -I https://example.com/old-page. You should see 301 or 302, and the new address in Location.
  2. Confirm that the final target returns 200 and is an equivalent page.
  3. Before changing a 302 to a 301 across the whole site, test the change on one URL. A 301 is heuristically cacheable, so clients may keep it without explicit freshness information. A wrong 301 can therefore stay in use after you change it.
  4. If the moved page embeds YouTube videos, check its thumbnail images as well. The YouTube thumbnail grabber can fetch a video's thumbnail so you can confirm the image still loads after the move. Use it only for images you have the right to use.

Sources

  1. RFC 9110: HTTP Semantics — IETF

Related posts

SEO

Can You Decrypt an MD5 Hash? How MD5 Really Works

Decrypting MD5 is not possible because MD5 is a one-way hash, not encryption. Weak passwords can still be matched by testing candidates, and salt prevents generic precomputed tables.

· 7 min read