301 vs 302 Redirects: What to Use and Why
Learn when a URL move should be permanent or temporary, how redirect chains happen, and what to test during a site migration.
A redirect is an HTTP response that tells the browser or crawler to request a different URL. The destination may look the same to a visitor whether you use 301 or 302, but the status code communicates your intent.
301: permanent move
Use a 301 when the old URL has been permanently replaced: a renamed page, an HTTP-to-HTTPS migration, a domain change, or a content consolidation where the old address should no longer be used.
302: temporary move
Use a 302 when the original URL is expected to return, such as short-term routing, a temporary landing page, or a maintenance situation where you do not want to declare a permanent replacement.
Map old pages to the closest equivalent new pages
During a redesign, do not send every removed URL to the homepage. A visitor who requested an old “pricing” page should land on the new pricing page or the nearest relevant alternative. If there is no equivalent content, a normal 404 or 410 can be more honest than an unrelated redirect.
Avoid chains
If A redirects to B and B redirects to C, update A to point directly to C when you control the rules. Chains add latency, make debugging harder, and can accumulate during repeated redesigns.
Avoid loops
A loop occurs when redirects eventually send the request back to a URL already visited. Browser messages such as “too many redirects” often point to conflicting HTTPS, www/non-www, trailing-slash, or application-level rules.
Preserve query strings deliberately
Some server rules keep query parameters automatically and others replace them. If campaign parameters, filters, or application parameters matter, test them instead of assuming they survive the redirect.
Migration checklist
- Crawl the old site and export important URLs.
- Map each old URL to a relevant destination.
- Generate and deploy the rules.
- Test status codes and final destinations.
- Update internal links so they point directly to the new URLs.
- Monitor 404 reports after launch.
