Migrations

301 vs 302 Redirect: What Google Does With Each (and the Default Trap)

By , Lead SEO & Co-founder 7 min read
Two identical dark doors side by side in a rain-wet brick corridor at night, one framed in a steady crimson glow, the other in a flickering amber light, a puddle reflecting both

The 301 vs 302 redirect choice comes down to one question: is the move permanent? A 301 tells Google "this page lives at the new address now, index that one." A 302 says "it's over there for a while, keep the old address." Pick by intent and you're mostly done.

The catch is that you often don't get to pick. Apache, PHP, WordPress and Nginx all send a 302 by default when a redirect is written without a status code. So plenty of sites that "set up 301s" are actually running 302s. That's the trap this post is mostly about.

301 vs 302 redirect: at a glance

A 302 is the better pick if: the original page is coming back. Think a seasonal page, a short maintenance detour, an A/B test, or a "you must log in first" bounce.

A 301 is the better pick if: the old URL is retired for good. Domain changes, new URL structures, merged pages, HTTP to HTTPS, and www to non-www all belong here.

Are 301 and 302 even doing the same job?

Both send visitors to another URL, and to a person clicking a link they look identical. The difference is the message to search engines and browsers.

The HTTP standard spells it out. A 301 means the resource "has been assigned a new permanent URI", and future references should use the new one. A 302 means it "resides temporarily under a different URI," so clients should keep using the original. Same mechanism, opposite instructions about which address is the real one.

They have newer siblings too. A 307 is a temporary redirect and a 308 a permanent one, and both forbid the browser from changing the request method (for example, turning a form's POST into a GET). For ordinary web pages, 301 and 308 behave the same in Google, and so do 302 and 307.

What Google actually does with each

Google's redirects documentation splits redirects into two groups, and the split is the whole story:

Item Permanent Temporary
Status codes 301, 308 302, 303, 307
Other forms Instant meta refresh, JavaScript location Delayed meta refresh
Googlebot follows it? Yes Yes
Used as a signal for which URL to index? Yes, the target should become canonical No
Which URL usually shows in search The new one The old one
Browser caching Cached unless told otherwise Not cached by default

For permanent redirects, Google says the indexing pipeline "uses the redirect as a signal that the redirect target should be canonical." Canonical means the version Google treats as the real one. Elsewhere, Google ranks redirects as a strong signal, alongside rel="canonical" tags.

For temporary redirects, Googlebot follows the redirect, but the indexing pipeline doesn't treat it as that signal. Your old URL stays the one Google tends to show.

What about link value? Google's site-move guide states that 301 and other permanent redirects don't cause a loss in PageRank (Google's measure of link value). So the old worry that every 301 leaks link value can be retired.

People also ask whether Google eventually treats a long-running 302 as a 301. Sometimes it seems to, if every other signal points at the new URL. I wouldn't plan a migration around a "sometimes." If you mean permanent, say permanent.

If you're planning a move and want the redirects done right the first time, tell me about it in my migration questionnaire. I reply with a plan and a fixed quote within one business day.

Here's the part most comparisons skip. The tools you'd use to write a redirect quietly default to temporary:

Where the redirect is written What you get with no status code Source
Apache RewriteRule ... [R] 302 Apache mod_rewrite flags
Apache Redirect /old /new 302 Apache mod_alias
PHP header("Location: ...") 302 PHP manual
WordPress wp_redirect() 302 WordPress developer reference
Nginx rewrite ... redirect or return with only a URL 302 Nginx rewrite module
Cloudflare Pages _redirects file 302 Cloudflare docs

So a forum answer that says RewriteRule ^old-page$ /new-page [R,L] gives you a temporary redirect. Copy it into a domain migration, and every page of your old site tells Google "this is temporary, keep my old address." Several popular redirect gists go further and write R=302 on purpose for permanent domain moves.

The fix is always the same: say the number out loud.

.htaccess / Apache
## Root .htaccess, above "# BEGIN WordPress". A permanent move of one page.
## Could break: an existing rule for the same URL further down. Test with curl afterward.
RewriteEngine On
RewriteRule ^old-page/?$ https://www.example.com/new-page/ [R=301,L]

## The mod_alias version. Without "301" (or "permanent") this would be a 302.
Redirect 301 /old-services/ https://www.example.com/services/
PHP
<?php
// WordPress theme or plugin code: always pass the status, then stop the script.
// Without the 301, wp_redirect() sends a 302.
wp_redirect( 'https://www.example.com/new-page/', 301 );
exit;
Nginx
# Nginx server block. "permanent" means 301. "redirect" or a bare URL means 302.
rewrite ^/old-page/?$ /new-page/ permanent;
return 301 https://www.example.com$request_uri;

My .htaccess redirect guide has every common pattern with the status code spelled out, and my redirect generator tool writes the rules for you from a spreadsheet.

How to check which one you actually have

Don't trust the plugin screen. Ask the server:

Terminal
## Read-only: shows the status line and the Location header for one URL.
## Look for "301" or "308" on a permanent move. "302" or "307" means temporary.
curl -sI https://www.example.com/old-page/ | grep -iE "^HTTP|^location"

If the result shows a chain (one redirect pointing to another), flatten it so the old URL goes straight to the final page. Google's site-move guide asks you to avoid chains, ideally no more than 3 hops.

One honest tip for testing. Browsers cache 301s hard, so a wrong 301 can stick in your own browser after you've fixed the server. While you're still testing rules, some developers use a 302 and then switch to 301 once everything checks out. That's fine, as long as switching back to 301 is on the launch checklist and doesn't get forgotten.

Where a 302 is the right call

A 302 isn't a bad redirect. It's a specific one. Good uses:

  • Seasonal pages. /holiday-hours/ sending visitors to /hours/ for three weeks.
  • Short maintenance. Sending a broken page to a status page while it's fixed.
  • Login bounces. Account pages sending logged-out visitors to the login screen.
  • Regional suggestions. Sending a visitor to a regional page while the main URL stays the one you want indexed.
  • A/B tests where the original stays the real page.

Where a 301 is the right call

  • Domain changes and mergers. The old address is never coming back.
  • New URL structures after a redesign or platform switch.
  • Consolidating pages, like three thin service pages merged into one.
  • HTTPS, www and trailing-slash rules. These are permanent by nature, and they should happen in one hop.
  • Deleted pages with a close replacement. A page with no real replacement should return a 404 or 410 (gone) instead of redirecting to the homepage.

Use a 302 if

  • The original URL will be back within weeks
  • You want the old URL to stay in Google's index
  • The redirect depends on who's asking (logged in, location, test group)

Use a 301 if

  • You'd be unhappy to ever see the old URL in search again
  • You're migrating, merging, or restructuring
  • Other sites link to the old URL and you want the new one to get the credit

Vlad's Final Take

On most small business sites, nearly every redirect should be a 301, and any 302 should be there on purpose. The risk isn't choosing wrong. It's not choosing at all and inheriting a default. Check your redirects with curl today. If a migration is coming up, my launch-day migration checklist puts the redirect test at the right hour of launch day. And if you'd rather have someone audit or build the whole thing, that's the core of my website migration service, with a one-off technical check of your redirects and indexing as a lighter option for checking an existing site.

301 vs 302 Redirect FAQs

Is a 301 or 302 better for SEO?

Neither is better in general. They say different things. A 301 tells Google the move is permanent and the new URL should be indexed, so it's right for migrations and merged pages. A 302 tells Google the move is temporary and to keep the old URL indexed, so it's right for short detours. Using a 302 for a permanent move is the mistake that hurts.

Google says 301 and other permanent redirects don't lose PageRank. With a 302, Google follows the redirect but keeps treating the old URL as the main one, so the credit tends to stay with the old address. If you want the new page to rank in place of the old one, use a 301 or 308.

What is the difference between a 301 and a 308 redirect?

Both are permanent, and Google treats them the same way. The difference is technical: with a 308, the browser must keep the original request method, so a form submission stays a form submission. With a 301, older clients may switch a POST to a GET. For normal pages, either works. For form endpoints and APIs, a 308 is safer.

How do I know if my redirect is a 301 or 302?

Run curl -sI on the old URL in a terminal and read the first line. It shows the status code. Browser developer tools show the same thing under the Network tab. Online redirect checkers work too. Don't rely on what a plugin or hosting panel says, since some tools label rules one way and send another.

How long should I keep a 301 redirect?

Google's site-move guide says to keep redirects as long as possible, generally at least one year. In practice, keep them indefinitely. They cost almost nothing to leave in place, and other websites keep linking to old URLs for years. Removing a redirect turns those links into dead ends.

Want a second pair of eyes on your site?

Tell me what's going on in the website migration questionnaire. I reply with a plan and a fixed quote within one business day.

Starting at $300 Start the questionnaire