Technical SEO

301 or 302: which redirect fits when?

What the status codes mean for Google, how to set them up and how to avoid chains during a migration.

/old/interim/new302301/old/new301 direct
Michael WeberLast updated: October 15, 20269 min read
In short
  • 301 and 308 signal a permanent move. Google then treats the target as the canonical URL.
  • 302, 303 and 307 are temporary. The old URL can stay in the search results.
  • Every redirect points straight to the final target. By default Googlebot follows ten hops, and every chain costs time.

What types of redirect are there?

A redirect sends browsers and crawlers from one URL to another. The most reliable option is a server-side redirect. The server responds with a status code in the 3xx range and names the target in the Location header. There are also redirects in the HTML via meta refresh and redirects via JavaScript.

TypeMeaning according to RFC 9110How Google treats it
301 Moved PermanentlyMoved permanently. For historical reasons, browsers may turn a POST into a GET.Permanent, strong signal for the target
308 Permanent RedirectMoved permanently, the method stays the sameLike 301
302 FoundTemporarily located elsewhere, the old URL stays validTemporary, weak signal for the target
303 See OtherPoints to a different resource after a form submissionLike 302
307 Temporary RedirectTemporary, the method stays the sameLike 302
Meta refresh with 0 secondsNo HTTP status, instruction in the HTMLPermanent
Meta refresh with a delayNo HTTP status, instruction in the HTMLTemporary
JavaScript (location)No HTTP status, only visible after renderingPermanent, if Google renders the page

Google recommends permanent server-side redirects wherever possible. According to Google, you should only use JavaScript redirects if server-side redirects and meta refresh are not an option. If rendering fails, Google never sees the redirect.

When is 301 right, and when 302?

The underlying question is which URL should appear in search. With a permanent redirect, the target takes on that role. With a temporary one, the old URL usually stays canonical, although Google still follows the redirect.

CaseRedirect
Migration, new URL structure, domain change301 or 308
Switch from http to https, from www to non-www301 or 308
Product is gone for good and there is a suitable successor301 to the successor
Product is briefly sold out and will be backNo redirect, the page stays with a notice
Maintenance or a short promotion, after which the old URL applies again302 or 307
Form submitted, followed by a thank-you page303

If the move is permanent, send a permanent code as well. Other search engines and clients read the codes too, so the right code is worth it even where Google treats two codes the same.

Setting up redirects

Where you maintain redirects depends on your setup. With many rules, it helps to keep them in one place, for example in the server configuration or in the CDN. That way you spot overlaps between old and new rules earlier.

Apache

# .htaccess or vHost, mod_alias Redirect 301 /gartenmoebel/alter-tisch/ https://www.example.com/gartenmoebel/tische/teak-120/ RedirectMatch 301 ^/blog/(.*)$ https://www.example.com/ratgeber/$1

nginx

# nginx, in the server block location = /gartenmoebel/alter-tisch/ { return 301 https://www.example.com/gartenmoebel/tische/teak-120/; }

Checking in the terminal

With curl you see every hop and the final status. If there is more than one redirect, you have a chain.

curl -sIL https://www.example.com/alt/ | grep -iE "^(HTTP|location)" HTTP/2 301 location: https://www.example.com/neu/ HTTP/2 200

Chains and loops

A chain occurs when A redirects to B and B redirects to C. A typical cause is a combination of several rules, for example http to https, then non-www to www, then old URL to new URL. In a loop, C points back to A, and browsers stop with “too many redirects”.

What Google says
  • By default, Googlebot follows ten hops.
  • Google ignores the content of a redirecting URL and only processes the target.
  • For site moves, Google recommends redirecting straight to the final target. If that is not possible, keep it to three hops at most, and in any case fewer than five.
  • The URL Inspection tool in Search Console does not follow redirects.

You find chains with a crawl that logs every hop individually. Three lists matter: internal links to redirects, redirects with more than one hop, and redirects whose target returns an error. Point internal links straight to the final target. Adjust old rules so that they redirect directly to the new target.

Redirects during a migration

During a migration, the redirect mapping decides whether rankings move with you. Every old URL with clicks, rankings or backlinks gets the target that matches its content.

  1. Collect old URLs from Search Console, web analytics, Rank Tracking, backlinks and a crawl of the old website.
  2. Assign each URL a target that matches its content and search intent. The homepage is only the last resort.
  3. Export existing redirects and switch their targets to the new URLs. That way, no new chains appear.
  4. Cover every variant of the old URL: with and without www, http and https, with and without a trailing slash.
  5. Test on the staging environment before go-live. Check beforehand whether the error page there returns a real 404 status, otherwise missing pages look like hits.
  6. After go-live, crawl all old URLs again and compare status and target with the mapping.
  7. Keep redirects for at least a year, as Google recommends for site moves. After that, log files and backlinks show which rules can go.

When changing domains, a global rule that only swaps the domain name is risky. It carries old errors and unnecessary URLs over to the new domain. One-to-one rules for the important URLs and patterns for the rest work better. The guide Testing redirects shows step by step how to test redirects before and after a migration.

Common mistakes

  • All old URLs redirect to the homepage. Google may treat this as a soft 404.
  • A 302 stays in place after the migration, although the move is permanent.
  • Internal links, canonicals and the XML sitemap still point to old URLs.
  • New rules and old redirects create chains.
  • The target of a redirect returns a 404 or redirects itself.
  • Redirects are deleted after a few weeks because the new website is “up and running”.

Frequently asked questions

What does status 301 mean?

“Moved Permanently”. The page can be found permanently at a new URL, and the server names the new address in the Location header.

Does a 301 redirect pass on link equity?

Google treats a 301 as a strong signal to process the target and treat it as canonical. The old URL can still appear in the results for a while as an alternative name.

Is a 302 instead of a 301 a problem?

Rarely in the short term. Google follows both. With a 302, however, the old URL can stay in the results. For permanent moves, 301 or 308 is correct.

How long should I keep 301 redirects?

As long as possible, according to Google generally at least one year. Google also says that users benefit from redirects that stay in place permanently.

How do I set up a 301 redirect in .htaccess?

With the line “Redirect 301 /alter-pfad/ https://www.example.com/neuer-pfad/”. For patterns, use RedirectMatch or RewriteRule.

What is the difference between 301 and 308?

Both are permanent and equivalent for Google. With 308, the browser must not change the method. A POST therefore stays a POST.

During a migration, searchVIU matches old and new URLs, suggests suitable targets and exports the rules as CSV, for Apache or nginx. After go-live, searchVIU checks every hop and weights errors by the clicks of the old URL. Find out more on the Redirect mapping page.

Request a demo

Sources

Retrieved on October 15, 2026. If something is out of date or missing, let us know.

  1. RFC 9110, HTTP Semantics, section 15.4 Redirection 3xx: https://www.rfc-editor.org/rfc/rfc9110.html#name-redirection-3xx · June 2022
  2. Google, Redirects and Google Search: https://developers.google.com/search/docs/crawling-indexing/301-redirects · As of Apr 14, 2026
  3. Google, HTTP status codes, network and DNS errors: https://developers.google.com/crawling/docs/troubleshooting/http-status-codes · As of Feb 4, 2026
  4. Google, Site moves with URL changes: https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes · As of Aug 20, 2026
  5. Apache HTTP Server, mod_alias: https://httpd.apache.org/docs/2.4/mod/mod_alias.html
  6. nginx, ngx_http_rewrite_module (return): https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return