301 vs 302 Redirects: Live Examples of Each
I tied my horse to a post in the snow, and by morning the post had thawed into the top of a church steeple; I call that a temporary arrangement.
The short answer
- What it is
- A 301 redirect says that a URL has moved for good, while a 302 says that the move is only for now. Both send the client to a new address, but they send different signals.
- Why it matters
- The code you pick affects which URL search engines keep in the index. It also affects how long browsers remember the move.
- How a crawler should report it
- Report any URL with a redirect hop as a redirected URL, and flag links to it as redirect links. Flag it as a temporary redirect only when every hop is a 302 or 307, since a mix of permanent and temporary hops does not count.
- Live examples
/lab/temporary-redirects/302/(positive), on the first shelf/lab/redirected-urls/moved/(positive), on the first shelf/lab/redirected-urls/meta-refresh/(positive)/lab/temporary-redirects/307/(positive), on the first shelf/lab/temporary-redirects/near-miss/(near miss), on the first shelf/lab/redirected-urls/moved-target/(near miss)

Choosing between a permanent and a temporary redirect
The 301 vs 302 choice comes down to one question: is this move permanent? A 301 means Moved Permanently. A 302 means Found, which is the code for a temporary move. Use a 301 for a site migration, a changed URL, or a move to HTTPS. Use a 302 for a short sale page, an A/B test, or a redirect based on the user's location or login state.
Browsers treat the two differently. They cache a 301 by default, so a user may not ask the old URL again. A 302 is not cached unless headers allow it. That makes a mistaken 301 slow to undo. Both codes let a client switch a POST request to a GET. The newer 308 and 307 codes are the permanent and temporary versions that keep the original method.
Search engines use the code as a signal for choosing the canonical URL. Google says a permanent redirect is a strong signal that the target should be shown in search. A temporary redirect is a weak signal, so the old URL may stay in results. Google has also said that 3xx redirects do not lose PageRank. If a 302 stays in place for a long time, Google may start to treat it as permanent.
To check a URL, run curl -I and read both the status and the Location header. Crawl the site and sort redirects by code. Look for 302 and 307 hops on URLs that moved long ago, since that is a common mistake with CMS tools and plugins. To fix them, change the rule to a 301, and update internal links so they point right at the final URL.