Choosing between a 301 and 302 redirect affects search signals, caching, campaign behaviour and how future requests are handled. This practical checklist explains when to use 301, 302, 307 or 308, how to implement the rule across common platforms, and how to test it before it causes avoidable problems.
Overview
A redirect tells a browser, crawler or other client that a requested URL should be resolved somewhere else. The HTTP status code communicates whether that change is intended to be permanent or temporary.
Use a 301 redirect when a URL has permanently moved and the old address should no longer be the primary destination. Use a 302 redirect when the change is temporary and you expect to restore the original URL. The less commonly used 307 and 308 statuses provide similar temporary and permanent meanings, while more explicitly preserving the request method.
For ordinary website links, the practical decision is usually straightforward:
- Permanent move: choose 301, or 308 where your application and infrastructure are designed for it.
- Temporary routing: choose 302, or 307 where preserving the request method is important.
- Campaign or experiment: use a temporary redirect only while the original destination remains the intended long-term URL.
- Site migration: map each retired URL to its closest relevant replacement and implement permanent redirects.
A redirect is not a substitute for a canonical tag, a rewrite rule or a DNS record. DNS can point a domain to infrastructure, but the web server or edge platform normally decides which HTTP status and destination URL a visitor receives.
301 vs 302: quick decision table
| Status | Meaning | Typical use | Key implementation consideration |
|---|---|---|---|
| 301 | Permanent redirect | Old page replaced, domain change, HTTP to HTTPS, URL restructuring | Can be cached; confirm the destination before publishing |
| 302 | Temporary redirect | Short-term campaign, maintenance route, temporary test | Keep the original URL as the intended long-term address |
| 307 | Temporary redirect with method preservation | Temporary application routing where request method and body matter | Test POST, PUT or other non-GET requests explicitly |
| 308 | Permanent redirect with method preservation | Permanent application or API endpoint move | Use only when clients and the full stack handle it correctly |
Search engines can treat a permanent redirect as a strong signal that the destination should replace the old URL. A temporary redirect generally indicates that the original URL may remain the preferred result. That is guidance, not a reason to select a status solely for SEO: the status should accurately describe the business and technical intention.
Checklist by scenario
1. A page, product or article has moved permanently
- Choose the most relevant replacement, rather than sending every old URL to the homepage.
- Create a direct 301 from the old URL to the final destination.
- Update internal links, XML sitemaps, navigation and structured references to use the new URL.
- Check that the destination returns a successful response and does not redirect again.
- Keep a record of the old URL, new URL, status code and implementation location.
For a large migration, build a bulk redirect map before changing the site. The redirect mapping template and pre-launch checklist provides a useful planning structure.
2. A change is temporary
- Use a 302 for normal browser navigation when the original URL should remain the long-term address.
- Use a 307 if the request method must be preserved, such as in an application workflow.
- Set an owner and review date so the temporary rule does not become permanent by accident.
- Check how your CDN, browser and hosting platform cache the response.
- Remove or revise the rule when the temporary condition ends.
A seasonal landing page, for example, may use temporary routing during a campaign. However, a campaign tracking link should not automatically replace the canonical page URL. Add UTM parameters to the campaign destination where appropriate, and make sure the redirect itself does not strip or duplicate those parameters.
3. HTTP to HTTPS or www to non-www consolidation
When consolidating URL variants permanently, use a consistent 301 policy for each old variant. Decide whether the preferred format is HTTPS, HTTP, www or non-www, then make every non-preferred variant resolve directly to that format. Avoid a sequence such as HTTP to HTTPS to www to non-www if one rule can reach the final URL in a single hop.
Review certificate coverage, host configuration, application-generated links and canonical tags before switching traffic. A redirect cannot correct an incorrectly configured origin server or an incomplete certificate.
4. An API or form endpoint has moved
For GET-only requests, a 301 or 302 may be adequate when the move is permanent or temporary respectively. For requests that submit data, test method preservation and request-body handling. A 307 or 308 is designed to communicate that the client should repeat the request using the same method, but compatibility still depends on the clients, proxy layers and application code involved.
Do not test an endpoint move only by opening it in a browser. Send representative requests in a controlled environment and confirm authentication, headers, body data and response handling.
5. Implementing the rule on common platforms
Implementation syntax varies, but the decision does not. In Apache, a permanent redirect may be written using a suitable Redirect or rewrite rule. In Nginx, a return 301 or return 302 directive is commonly used. Cloudflare and similar edge platforms normally provide redirect rules or bulk rules with a selected status. WordPress sites may apply redirects through server configuration or a redirect-management plugin.
Choose one authoritative layer where possible. Overlapping WordPress, server and CDN rules make it harder to identify the active status, and rule order can create chains or loops. See the guide to Apache, Nginx, Cloudflare and WordPress redirects for platform-specific trade-offs.
What to double-check
- Final status: request the original URL and record every response, not just the final page.
- Destination relevance: confirm that the replacement serves substantially the same user intent.
- Redirect chain: make the old URL point directly to the final URL wherever possible.
- Redirect loop: check that rules do not send the request back to its original host, path or protocol.
- Query strings: verify whether useful parameters are preserved, removed or safely transformed.
- Cache behaviour: a permanent response may be cached by clients or intermediary systems, so test with the intended headers and deployment path.
- Canonicalisation: the canonical tag, internal links, sitemap and redirect destination should support the same preferred URL.
- Security: avoid accepting arbitrary user-supplied destinations, which can create an open redirect.
- Monitoring: watch server logs, analytics landing pages, crawl reports and 4xx responses after release.
Use a redirect checker or command-line request to inspect the complete chain. A useful test records the status code, Location header, protocol, host, path, query string and response time. For a wider review, follow the redirect performance testing guide and measure crawl hops as well as page availability.
Common mistakes
Using 302 for a permanent migration
This can leave the intended replacement looking temporary and makes the migration harder to interpret. If the old URL has genuinely been retired, replace the 302 with a permanent redirect after testing.
Using 301 for a short-lived experiment
A 301 may be cached and can be difficult to reverse quickly across browsers, CDNs and other layers. Use a temporary status while the original URL remains the intended address, and establish a review date.
Redirecting unrelated URLs to the homepage
This may frustrate visitors and creates a poor destination for both users and crawlers. Where no close replacement exists, consider whether a clear 404 or 410 response is more accurate than a forced redirect.
Creating chains during a redesign
If an old URL goes to an intermediate URL and then to the final page, every extra hop adds another failure and caching point. Update the map so each legacy URL reaches its final destination directly. Also review rule precedence before deployment; the redirect rule order guide covers common conflicts.
Assuming a browser test proves everything works
Browsers can reuse cached responses, follow redirects automatically and hide method changes. Test with a fresh session, a command-line tool or redirect checker, and representative request types. If a 301 or 308 was published incorrectly, coordinate cache invalidation before retesting.
When to revisit
Review redirect decisions before a site migration, domain change, HTTPS rollout, information-architecture restructure or major campaign. Recheck them before seasonal planning cycles if temporary campaign routes are reused, and whenever your CDN, hosting provider, CMS, server configuration or deployment workflow changes.
Keep a simple redirect register with the source URL, destination, status, owner, reason, date added and next review date. At each review:
- Export current redirect rules from the application, web server and edge platform.
- Find 301, 302, 307 and 308 responses using logs or a redirect checker.
- Confirm that permanent rules still point to the correct live pages.
- Identify temporary rules that can now be removed or made permanent.
- Fix chains, loops, stale destinations and inconsistent URL variants.
- Run a small set of browser, crawler and application tests after publishing changes.
For a repeatable migration process, combine this status-code checklist with a website migration redirect map and a post-launch performance review. The right redirect is the one that accurately reflects the intended lifetime of the URL, works across the full delivery stack and gives visitors a direct path to the content they expect.