301 vs 302 Redirects for SEO: Which Redirect to Use and When

Crawvix Editorial Team · Published October 29, 2026 · Last updated October 29, 2026 · 9 min read

A redirect sends a visitor, or a crawler, from one address to another. The server replies with a status code in the 300 range and a Location header holding the new address. The browser then loads that new address. The code tells the client how to think about the move: is it permanent, or only for now?

The 301 vs 302 redirect question is the one site owners ask most. A 301 means the page moved permanently. A 302 means it is somewhere else temporarily. Choosing the wrong one can leave an old address in search results when you wanted it replaced, or move a result to a temporary page that you intended to be short-lived. This guide is for owners and developers who add redirects during redesigns, URL changes, HTTPS moves and campaigns. By the end you will know which code to use, how Google reads each one, how to write it on common servers and how to check the result.

Redirects pass a signal about which URL should be shown. Google decides if and when it switches, so a redirect is a strong hint and not a command.

Before you begin

You will need:

  • A list of the old addresses and the new addresses they should lead to. A spreadsheet with two columns is enough.
  • Access to where redirects are configured: web server, hosting panel, CDN, CMS plugin or application code. Find out which layer owns the rule before you add one.
  • A command line with curl, or browser developer tools, to inspect responses.
  • About an hour for a handful of redirects. A large mapping needs more time and a staging test.

The main risk is making a wrong or looping rule that makes pages unreachable. Back up the configuration file before editing, test on a few URLs first and keep a way to undo the change.

The status codes in plain English

Five codes matter for websites. The descriptions below follow the HTTP specification (RFC 9110) and MDN.

Code Name Meaning Request method
301 Moved Permanently The resource has a new permanent address. A client may change POST to GET.
308 Permanent Redirect Same meaning as 301. Method and body are kept.
302 Found The resource is temporarily at another address. A client may change POST to GET.
307 Temporary Redirect Same meaning as 302. Method and body are kept.
303 See Other Go and fetch another address with GET, often after a form post. Changed to GET.

The 308 and 307 codes exist to remove an ambiguity. In early HTTP, 301 and 302 were meant to keep the request method, but clients commonly changed a POST into a GET. The specification now allows that for 301 and 302 and defines 307 and 308 as the clear method-preserving versions. For ordinary page views, which are GET requests, the difference does not matter. It matters for forms and APIs that send data.

RFC 9110 also says that 301 and 308 responses are heuristically cacheable, so browsers may remember a permanent redirect. That is a reason to test carefully, because a wrong permanent redirect can stick in visitors' caches.

How Google treats permanent and temporary redirects

Google's redirect documentation sorts redirects into two groups.

  • Permanent: HTTP 301 and 308, plus a meta refresh or HTTP refresh set to 0 seconds. Google follows the redirect and treats it as a signal that the target should be the canonical address.
  • Temporary: HTTP 302, 303 and 307, plus a meta refresh or HTTP refresh with a delay above 0 seconds. Google follows the redirect, but it is not a canonical signal. The original address may stay in results, and the target might be indexed only if other signals support it.

Google lists server-side redirects as the form most likely to be interpreted correctly. It says to use a permanent redirect when you are confident the move will not be reverted, and whenever you need to change the URL shown in results. It says to use a temporary redirect for short-term changes, such as a service that is temporarily unavailable, so the original URL stays in results.

Note that 301 and 308 are in the same group for Google, as are 302, 303 and 307. For search purposes, the choice between 301 and 308 is mostly about method handling, not about SEO.

Google's site move guidance also says that 301 and other permanent redirects do not cause a loss in PageRank.

Step-by-step instructions

Step 1: Decide whether the move is permanent

Ask one question: will the old address ever come back? If a page has been renamed, merged, moved to a new section, switched from HTTP to HTTPS, or moved to another domain, the answer is no, so it is permanent. If you are sending visitors to a holding page during maintenance, running a short promotion, or testing a new page, the answer is yes, so it is temporary.

When in doubt, choose by what you want to show in search results. If you want the new URL to replace the old one, use a permanent redirect.

What success looks like: every old address in your mapping has a label of permanent or temporary.

Step 2: Choose the status code

For permanent moves of pages, use 301. Use 308 if the old address receives non-GET requests that must keep their method, such as form submissions or API calls. For temporary moves, use 302, or 307 when the method must be preserved. Avoid 303 for page moves. It is meant for "go and look at this other resource after the post you just made".

If your platform only offers one choice, check the default. For example, MDN notes that Apache's Redirect directive defaults to 302 unless you ask for permanent. Leaving a default 302 in place for a permanent move is a common mistake.

What success looks like: each mapping row has a code that matches its intent.

Step 3: Write the rule on the server

Write server-side redirects. Google says to use meta refresh or JavaScript redirects only if a server-side redirect is not possible. A script redirect only works if Google renders the page, and if rendering fails, Google might never see it.

Apache, in .htaccess or the site configuration:

# Permanent
Redirect permanent /old-page https://example.com/new-page

# Temporary (302 is the default for plain Redirect)
Redirect temp /summer-sale https://example.com/promotions/summer

Nginx:

location = /old-page {
  return 301 https://example.com/new-page;
}

location = /summer-sale {
  return 302 https://example.com/promotions/summer;
}

PHP:

<?php
header('Location: https://example.com/new-page', true, 301);
exit;

The exit matters. Without it, the script keeps running after the header. Many content management systems and hosting panels offer a redirect manager that writes these rules for you. Use it if you have one, and choose "permanent" or "301" deliberately.

Always redirect to the final address with the correct scheme and host, and to the genuinely matching page. Sending many different old pages to the home page is poor for visitors and, in migrations, Google advises against irrelevant redirects.

What success looks like: the rule exists in one layer only and points directly at the final URL.

Step 4: Test the response

Check the status and Location without following the redirect:

curl -sI https://example.com/old-page

Look for output like this:

HTTP/2 301
location: https://example.com/new-page

Then follow the redirect and check the final page returns 200:

curl -sIL https://example.com/old-page | grep -iE "^(HTTP|location)"

You should see one redirect line followed by a 200. If you see several redirects, you have a chain. If it repeats until the client gives up, you have a loop; see Redirect Chains, Loops, and Incorrect HTTP Status Codes. RFC 9110 says clients should detect and intervene in cyclical redirections.

Also test with query strings, with a trailing slash and with the www and non-www variants of the host. See WWW vs Non-WWW for host rules.

What success looks like: each tested address returns the expected code, goes to the expected target in one hop and ends in 200.

A redirect is a safety net. The site should not depend on it for normal navigation. Update internal links so they point straight to the new address, change canonical tags to match, and list only the new URL in the XML sitemap. A sitemap should hold the canonical URLs you want in search results, not addresses that redirect. See Find Broken Internal Links and Redirects and How to Create a Valid XML Sitemap.

What success looks like: a crawl of your site finds no internal links that pass through a redirect.

Step 6: Keep the redirect long enough

For a permanent move, Google's site move guidance says to keep redirects for at least one year, and to consider keeping them indefinitely. For a domain move that uses the Change of Address tool, Google's help page says to keep them at least 180 days and longer if the old URLs still get search traffic. Temporary redirects should be removed or converted when the temporary period ends. If a temporary redirect is still live a year later, ask whether it should have been permanent.

What success looks like: you have a note of the date each redirect was added and when it will be reviewed.

Step 7: Change a redirect type later if you need to

If a 302 has been in place and you now know the move is permanent, change the code to 301. Google will pick up the new signal when it recrawls. Remember that browsers may have cached a permanent redirect: if you used a 301 by mistake and the old page needs to return, the redirect may linger in some caches. Test carefully before choosing a permanent code.

What success looks like: the status code now matches the real situation.

Final verification checklist

  • Each redirect is labelled permanent or temporary with a reason.
  • Permanent moves return 301 or 308, temporary moves return 302 or 307.
  • Redirects are server-side, not meta refresh or JavaScript, unless that was impossible.
  • Each old address reaches its final page in one hop and ends in a 200 response.
  • No redirect loops or chains appear in tests.
  • Redirect targets are the closest matching pages, not the home page by default.
  • Internal links, canonical tags and sitemap entries use the final URL.
  • Redirects are logged with a review date.

Common mistakes to avoid

  • Leaving a default 302 on a permanent move. Check the default of your server directive and plugin.
  • Using 301 for a short campaign. A permanent signal for a temporary move can keep the wrong page in results and stick in caches. Use 302 or 307.
  • Redirecting everything to the home page. Redirect each page to its closest equivalent.
  • Meta refresh or JavaScript as the first choice. Prefer a server-side redirect.
  • Chains from old rules. Update the first rule to point at the final target.
  • Redirects with no cleanup. Update links and the sitemap so the redirect is not the main path.
  • Removing redirects too soon. Keep permanent redirects for at least a year, and consider keeping them indefinitely.
  • Forgetting the method. For forms and APIs that post data, use 307 or 308 so the POST is preserved.

Frequently asked questions

Does a 301 pass all ranking value?

Google says 301 and other permanent redirects do not cause a loss in PageRank. That does not promise your rankings stay the same, since other changes, such as new content or layout, also matter.

Is a 302 bad for SEO?

No. It is the right code for a temporary move. It is a problem only when used for a permanent one, because Google does not treat it as a signal that the target should be canonical.

What is the difference between 301 and 308?

Both are permanent. 308 keeps the request method and body, while a client may change a POST to a GET after a 301. For normal page links there is no practical difference.

Do meta refresh redirects work?

Google treats an instant (0-second) meta refresh as permanent and a delayed one as temporary, but prefers server-side redirects and suggests the meta form only when you cannot use them.

How long does Google take to switch to the new URL?

Google does not give a fixed time. It needs to recrawl the old address and process the signal. Site move guidance says even medium-sized sites can take a few weeks or more to show new URLs.

Official references


Next step: See how Crawvix checks a website and capture a baseline once scanning opens. This guide provides technical information, not a guarantee of rankings, traffic or index inclusion.

In this category

All 19 Crawlability guides