Free SEO audit for new clients — claim yours
Home/Learn SEO/Chapter 5: Technical SEO/Redirects: 301, 302 and When to Use Them
Chapter 5 · Lesson 33 of 65

Redirects: 301, 302 and When to Use Them

Learn the difference between permanent and temporary redirects, which methods Google handles best, and how to avoid chains, loops and bad redirects.

By Rohit Choudhary · 9 min read · Updated October 2026

You renamed a page, moved your blog to a new folder or deleted a product you no longer sell. Now the old address either shows an error or still sits in Google’s results. Should you redirect it? Is it a 301 or a 302? And what happens to the rankings the old page had earned? Redirects sound technical, but the ideas behind them are simple once you see them laid out.

In this lesson, I will explain what a redirect is, the difference between permanent and temporary redirects, which methods Google handles best, how to avoid chains and loops, and when it is better to show a 404 instead. By the end, you will be able to choose the right redirect for any situation on your site.

What is a redirect?

A redirect automatically sends a visitor, or a search engine crawler, from one URL to another. You type in the old address and land on the new one, usually without noticing.

It works a lot like a mail forwarding service. When you move house, you ask the post office to send letters for your old address to your new one. Without that, letters get lost. Without redirects, visitors and links that point to your old pages hit a dead end.

Behind the scenes, the server answers the request for the old URL with a short message that includes an HTTP status code (a three-digit number that tells the browser what happened) and the new location. Codes that start with 3 are redirects. You may remember status codes from the lesson on how search engines work; 200 means “OK,” 404 means “not found,” and 3xx means “look over there instead.”

Redirects matter for SEO for three reasons:

  • Visitors reach the right page instead of an error.
  • Google learns which URL should now appear in results.
  • Links from other sites that point to the old URL keep being useful, because they lead somewhere relevant.

What is the difference between a 301 and a 302 redirect?

This is the question everybody asks first. The short answer: a 301 says “this move is permanent,” and a 302 says “this move is temporary.” Google treats them differently for one key reason, which is which URL it shows in search.

TypeStatus codesWhat Google doesTypical use
Permanent301, 308Treats the new URL as the canonical (main) one. It is a strong signal.Renamed pages, merged content, HTTP to HTTPS, domain change
Temporary302, 303, 307Follows the redirect but treats it as a weak signal; the old URL may stay in results.A short promotion, a page under maintenance, a brief outage

Google’s advice is to use a permanent redirect when you are sure it won’t be reverted. In practice, most redirects you will set up for SEO are 301s. If you used a 302 by mistake for a permanent move, Google may keep showing the old URL, so it is worth checking. My post on 301 vs 302 redirects has more examples of each.

What about 307 and 308? They are newer cousins of 302 and 301. For Google Search, a 308 is treated like a 301 and a 307 like a 302. You will mostly meet them on HTTPS setups and modern hosting platforms, and you don’t need to do anything special about them.

How do you set up redirects the way Google prefers?

There is more than one way to set up a redirect. Google’s documentation lists them in roughly this order of preference.

Server-side redirects (the best choice)

These are set up on the web server, for example in an .htaccess file on Apache servers, in NGINX configuration, or through a redirect plugin or your platform’s settings. The server sends the 301 or 302 before any page loads. Google recommends server-side redirects whenever possible because they are the most reliable. If your site runs on Apache, my guide on setting up 301 redirects in .htaccess shows the exact lines. On WordPress, a redirect plugin does the same job without touching code, and Shopify has a built-in URL redirects section.

Meta refresh redirects

A meta refresh is a tag in the page’s HTML that tells the browser to go to another URL. Google says to use it only when server-side redirects are not possible. An instant meta refresh (zero seconds) is treated as permanent; a delayed one is treated as temporary.

JavaScript redirects

A JavaScript redirect changes the page location with code. Google can follow it, but only after it renders the page, and if rendering fails it may never see the redirect. Google calls this a last resort.

“We have moved” links

Some sites simply show a note with a link to the new page. Google calls these crypto redirects and says not to rely on them. Use a real redirect instead. For more on the last two methods, see meta refresh and JavaScript redirects.

Avoid redirect chains and loops

A redirect chain happens when one redirect leads to another, which leads to another. For example: http://example.com/shoes → https://example.com/shoes → https://www.example.com/shoes → https://www.example.com/shoes/. Four URLs, three hops, to reach one page.

Chains usually build up over years, as a site moves to HTTPS, then changes its URL structure, then redesigns. Each change adds a hop on top of the old one. Chains slow visitors down and make it harder for crawlers. Google’s crawlers follow up to 10 redirect hops by default, but Google’s site-move guidance recommends redirecting to the final destination directly and, if you can’t, keeping chains short, ideally no more than 3 hops.

A redirect loop is worse: page A redirects to B, and B redirects back to A. The browser gives up with an error like “too many redirects,” and nobody can reach the page.

The fix for both is the same. Find the original URL and point it straight to the final page in one hop. Then update your internal links to point to the final URL, so you rely on redirects as little as possible. My guide on fixing redirect chains and loops shows how to find them with a crawler.

When should you use a 404 or 410 instead of a redirect?

Not every old page needs a redirect. Redirecting everything to your home page is a common mistake. If the page you redirect to doesn’t match what the visitor wanted, it is a poor experience, and it doesn’t tell Google anything useful about where the old content went. It is a close relative of the soft 404 problem (pages that act like errors but don’t say so).

Here is how I decide, page by page:

  • There is a close replacement (a new version of the product, an updated article, a merged page): use a 301 to that replacement.
  • There is no relevant replacement and the content is gone for good: let the URL return a 404 (“not found”) or 410 (“gone”).
  • The page is temporarily unavailable but will come back: keep the URL, or use a temporary redirect.

Is 410 better than 404? Many people believe so, but Google’s documentation on HTTP status codes says that all 4xx errors, except 429, are treated the same way. Either will remove a previously indexed URL from the index over time. A 404 is not a penalty; it is the honest answer for a page that no longer exists. Just make your 404 page helpful, with a search box and links to popular sections. See how to find and fix 404 errors for a full process.

How do redirects fit into bigger site changes?

Redirects are the backbone of any site move or redesign. When URLs change in bulk, such as moving from HTTP to HTTPS, changing your domain, or restructuring categories, you need a redirect map: a list of every old URL and the new URL it should point to.

A small example of a redirect map (invented, for illustration):

Old URLNew URLType
/services/web-design.html/services/web-design/301
/blog/2019/seo-tips//blog/seo-tips/301
/products/old-winter-jacket//products/winter-jacket-2026/301
/products/discontinued-gloves/(no close match)404

How long should you keep redirects? Google’s site-move guide says to keep them as long as possible, generally at least one year, and from a user’s point of view to consider keeping them indefinitely. I suggest you simply never remove them unless they cause a problem. We will cover the full process in the lesson on site migrations, and my website migration checklist is a good companion.

One more case worth mentioning: automatically redirecting visitors by country or language based on their IP address. It can stop crawlers and visitors from ever reaching your other versions. My post on IP-based redirects explains the safer alternatives.

Try it: check five old URLs on your site

Let’s test your own redirects. This takes about 15 minutes.

  1. Make a list of five URLs that have changed on your site: an old page you renamed, the http:// version of your home page, the non-www (or www) version of your domain, a deleted product or post, and an old blog URL.
  2. Paste each one into a free online redirect checker (search for “HTTP status code checker”), or open Chrome DevTools, go to the Network tab, tick “Preserve log” and load the URL.
  3. For each URL, write down the status code of every hop and the final destination.
  4. Check: is it a 301 (or 308) for permanent moves? Does it reach the final page in one hop? Is the destination relevant?
  5. Fix any 302s that should be permanent, collapse any chains into one hop, and replace redirects to the home page with either a relevant page or a 404.
  6. Finally, update any internal links that still point to old URLs, so visitors and Google go straight to the final page.

Questions beginners ask about redirects

Do 301 redirects lose ranking value?

Google treats a permanent redirect as a strong signal that the new URL should become the canonical one, and it consolidates the old and new URLs. Moving to a relevant page is what matters most; redirecting to an unrelated page helps nobody.

Can I redirect all my old pages to the home page?

I don’t recommend it. If the home page doesn’t answer what the visitor was looking for, it is a confusing experience and gives Google no real replacement for the old page. Redirect to the closest match, or let the page return a 404.

How long until Google shows the new URL?

It depends on how soon Google recrawls the old URL. For a while, both may appear. Google says the old URLs fade away on their own once it processes the redirects.

Should I use a 302 during a website redesign?

Only if the change is genuinely temporary. If the new URLs are here to stay, use 301s from day one.

Redirects in a few lines, and what comes next

In brief: a redirect forwards visitors and crawlers from an old URL to a new one. Use 301s for permanent moves and 302s only for short-term ones. Set them up on the server whenever you can, send each old URL straight to its final destination, and keep them in place for at least a year, ideally forever. When there is no good replacement, a 404 is the honest answer.

With crawling, indexing and URLs sorted, it is time to look at how fast and smooth your pages feel. The next lesson is page speed and Core Web Vitals. If you are planning a site move and want help with the redirect map, feel free to get in touch for a free quote.

Sources for this lesson on redirects

  1. Redirects and Google Search – Google Search Central
  2. How HTTP status codes and network errors affect Google Search – Google Search Central
  3. Site moves with URL changes – Google Search Central
  4. How to specify a canonical URL – Google Search Central

Rather have experts handle your SEO?

Tell us about your website and goals, and we will send you a free, no-obligation custom plan.

CallFree Quote