Redirects: 301 vs 302 and When to Use Them

A redirect sends visitors and search engines from one URL to another. The two common status codes are 301 and 302. Choosing the right one helps browsers, search engines, analytics, and users understand whether a move is permanent or temporary.

What Is a 301 Redirect?

A 301 redirect means the move is permanent. Use it when an old URL has been replaced and you want the new URL to become the canonical destination.

Common 301 uses include:

  • Old page to new replacement page.
  • HTTP to HTTPS.
  • Old domain to new domain.
  • Non-www to www, or www to non-www.
  • Retired service page to the closest relevant service page.

What Is a 302 Redirect?

A 302 redirect means the move is temporary. Use it when the original URL should remain the main URL after the temporary situation ends.

Common 302 uses include:

  • Short-term maintenance pages.
  • Temporary campaign routing.
  • A/B tests where the original URL remains canonical.
  • Temporary stock or booking messages.

Avoid Redirect Chains

A redirect chain happens when URL A redirects to B, then B redirects to C. Chains slow visitors down and make troubleshooting harder. Update old rules so each old URL points directly to the final URL.

Old: /old-page → /new-page → /final-page
Better: /old-page → /final-page

Avoid Redirect Loops

A loop happens when redirects point back to each other. For example, one rule sends HTTP to HTTPS while another rule sends HTTPS back to HTTP, or a WordPress setting conflicts with a server rule.

If a browser says "too many redirects", check canonical domain rules, HTTPS settings, CDN settings, and application-level redirects.

How to Test a Redirect

Use browser testing and header testing. A terminal check is often clearer:

curl -I https://example.co.uk/old-page

Look for the status code and Location header. If you need to follow the full chain, use:

curl -I -L https://example.co.uk/old-page

SEO Notes

Redirect old pages to the closest relevant replacement. Do not send every removed URL to the homepage unless the homepage genuinely is the best match. A useful redirect preserves intent: old product to new product, old guide to updated guide, old category to current category.

Related TekLan Posts

Read How to Plan a Website Redesign Without Losing SEO, How to Test a Site After Moving Hosts, and SEO Checklist for a New Website.

← Older How to Check Website Error Logs in Enhance Newer → Subdomains vs Addon Domains Explained