301 vs 302 Redirect: Which One to Use (and When It Matters for SEO)
A redirect sends visitors and search engines from one URL to another. For a person, the result looks the same whichever type you use. For search engines, the type is a signal: "this page has moved for good" or "this page is temporarily somewhere else". Choosing the wrong one rarely breaks a site overnight, but it can slow down how quickly Google moves rankings to the new address and which URL it shows in results.
301 vs 302 in one sentence each
- 301 Moved Permanently — the old URL is gone for good; use the new one from now on. Search engines treat it as a strong signal that the target should be the indexed, canonical URL.
- 302 Found (temporary) — the content is temporarily at another address; the original URL remains the main one. Search engines tend to keep the original URL in the index.
If you are changing a URL and do not plan to change it back, use 301. If you will switch back (maintenance page, short promo, A/B test, out-of-stock product temporarily pointing elsewhere), use 302.
All redirect types at a glance
| Type | Meaning | Request method on redirect | Typical use |
|---|---|---|---|
| 301 | Permanent | Browsers may change POST to GET | URL changes, domain moves, HTTP→HTTPS |
| 302 | Temporary | Browsers may change POST to GET | Temporary moves, geo or language routing, tests |
| 303 | See other | Always GET | After a form submission ("post/redirect/get") |
| 307 | Temporary | Method and body kept | Temporary redirects of APIs and forms |
| 308 | Permanent | Method and body kept | Permanent moves where POST must stay POST |
| Meta refresh | HTML tag, delay 0 or more | — | When you cannot configure the server |
| JavaScript | window.location in a script | — | Single-page apps, last resort |
For SEO, Google’s documentation groups 301 and 308 as permanent and 302, 303 and 307 as temporary. The difference between 301 and 308 (or 302 and 307) matters to browsers and APIs, not to rankings.
How Google treats redirects
Google describes server-side permanent redirects as a strong signal for choosing the canonical URL, and temporary redirects as a weak one. In practice:
- With a 301/308, Google usually replaces the old URL with the new one in results and consolidates signals such as links on the target.
- With a 302/307, Google usually keeps showing the old URL for a while, because you said the move is temporary.
- If a 302 stays in place for a long time and the target looks like a permanent replacement, Google may eventually treat it as permanent. It is not a good idea to rely on that: if you mean permanent, say so with a 301.
- Meta refresh with zero delay is generally understood as a permanent redirect; one with a delay is treated as temporary. JavaScript redirects only work after the page is rendered, which happens later and is less reliable. Use both only when server redirects are impossible.
The redirect is just one canonicalization signal among several, along with the rel=canonical tag, internal links and sitemaps. Keep them consistent; see canonical address for how they work together.
When the choice actually matters
- Site migration or domain change — always 301 (or 308). A 302 here can keep old URLs in results longer and delay the transfer of signals.
- HTTP → HTTPS and www ↔ non-www — 301, once per URL, straight to the final version. These are permanent decisions.
- Deleted product or article with a close replacement — 301 to the replacement. If there is no real equivalent, a 404 or 410 is more honest than a redirect to the homepage, which Google may treat as a soft 404 anyway.
- Seasonal or out-of-stock pages that will return — 302, or better, keep the page live with a notice.
- Language or country detection — temporary redirects are common, but do not force-redirect search engine crawlers away from your language versions; link versions with hreflang instead.
Chains and loops
A chain is a redirect that leads to another redirect: http://example.com/page → https://example.com/page → https://www.example.com/page → https://www.example.com/new-page. Each hop adds a round trip for the visitor. Google follows a limited number of hops (its documentation mentions up to 10) and may stop before the end of a long chain. Fix chains by pointing every old URL directly at the final address and updating internal links to it.
A loop is a chain that returns to its own start — A → B → A. Browsers stop with "too many redirects" and the page is unreachable for everyone, including crawlers. Loops typically appear when two rules contradict each other, for example the CDN forces HTTP while the server forces HTTPS.
How to set up a 301
Configure redirects on the server or in your CMS, not in page code. The two most common web servers:
# Apache (.htaccess)
Redirect 301 /old-page/ https://example.com/new-page/
# Nginx
location = /old-page/ { return 301 https://example.com/new-page/; }
In WordPress and most other CMSs, a redirect plugin or the built-in redirect manager does the same without editing server files. If the site is behind a CDN, its redirect rules run before the request reaches your server — handy, but remember they exist when you debug. For a whole-domain move, redirect each path to the same path on the new domain rather than everything to the homepage. Whatever the method, check the result from outside: a typo in a rule can quietly return 302, create a loop or redirect pages you did not intend to touch.
How to check a redirect
Do not trust the browser address bar: browsers cache 301 redirects aggressively, so after you change a rule you may keep seeing the old behaviour. Check server-side instead:
- The redirect checker follows the whole chain and shows each hop with its status code, so you can spot 302s where you expected 301s, extra hops and loops.
- The HTTP status checker shows the exact code of a single URL and its final destination.
- From a terminal:
curl -I https://example.com/old-pageshows the status and theLocationheader.
A step-by-step guide to reading chains and finding their sources is in how to check redirects and redirect chains.
Migration checklist
- Export a full list of old URLs: from a crawl, the sitemap, analytics and Search Console (pages with traffic and backlinks first).
- Map each old URL to its closest new equivalent, one to one. Avoid sending everything to the homepage.
- Implement 301 redirects on the server, not with meta refresh or JavaScript.
- Combine protocol, host and path changes into a single hop where possible.
- Update internal links, canonical tags, hreflang and the sitemap to the new URLs, so that redirects serve only external links and bookmarks.
- Test a sample of old URLs (including ones with parameters and trailing slashes) with the redirect checker before and right after launch.
- For a domain change, use the Change of Address tool in Google Search Console and keep the redirects in place for a long time — Google recommends at least a year.
- Watch Search Console for 404s and redirect errors over the following weeks.