301 Redirects for SEO: Site Moves Without Losing Traffic

A 301 redirect tells Google a page moved for good. Here is which redirect to use, how to build a one-to-one URL map, setup code for common stacks and the checks that keep a site move from costing traffic.

Pixel-art two-way signpost pointing visitors to a new address, a site move where every URL gets a redirect.

A 301 redirect tells browsers and Google that a URL has moved for good, and sends them to the new one. For SEO, the rule is simple: redirect every old URL that has traffic, links or rankings to its closest match, in one hop, and keep the redirect live for at least a year. Do that and a site move costs a few weeks of wobble, not months of lost traffic.

Most traffic loss after a redesign isn't Google's fault. It's a missing redirect map. Someone changed the URL structure, redirected the old pages to the homepage and called it done.

This playbook covers which redirect to use, how to build a one-to-one URL map, setup code for common stacks, domain moves, the checks to run after launch and the mistakes that cost the most.

Key takeaways

  • Permanent means 301 or 308. Google treats them the same, and both say the new URL should be shown.
  • Map one to one. Send each old URL to its closest match, never to the homepage in bulk.
  • One hop only. Point every old URL straight at its final destination.
  • Keep them for good. Google says at least a year. Old links keep arriving long after that.
  • Check after launch. Crawl the old URLs, fix internal links and watch Search Console for a month.

10

Redirect hops Google's crawlers follow by default

Google Search Central

180

Days Google forwards signals after a Change of Address

Search Console Help

1 year

Minimum Google suggests keeping site move redirects

Google Search Central

What does a 301 redirect tell Google?

A 301 redirect is a server response that says "moved permanently" and names the new address. The browser follows it instantly. Googlebot follows it too, and treats it as a hint about which URL to show in search.

Google's page on HTTP status codes puts it plainly. Google uses a 301 as a strong signal that the redirect target should be processed. It uses a 302 as a weak signal. That's the whole SEO difference in one line.

Redirects matter for three reasons:

  1. Links. Other sites link to your old URLs. A redirect sends that value on. Without it, every backlink to a dead page stops helping.
  2. Rankings. Google needs a clear signal that the new page replaces the old one. Without it, the new page starts from zero.
  3. People. Bookmarks, old emails and shared links keep working.

Google's redirects documentation also says a server-side redirect has the best chance of being read correctly. So set redirects at the server, CDN or framework level. Use client-side tricks only when you have no other choice.

Which redirect should you use?

There are several kinds. Google sorts them into permanent and temporary. Here's what each one is for.

Redirect Google treats it as Use it for
301 Moved Permanently Permanent, strong signal Site moves, URL changes, merged pages
308 Permanent Redirect Same as 301 The default in Next.js and Vercel; fine for SEO
302 Found Temporary, weak signal A short promo or test, then back
307 Temporary Redirect Same as 302 Temporary moves that keep the request method
Meta refresh, 0 seconds Permanent Static hosts with no server access
Meta refresh, delay Temporary Rarely a good idea
JavaScript location Permanent, if Google renders the page Last resort only
410 Gone Not a redirect: page removed Content you deleted on purpose
Canonical tag Not a redirect: a hint about duplicates Two live versions of the same page

The HTTP status page says Google treats 308 the same as 301 and 307 the same as 302. They differ only in how browsers resend the request. So if your framework uses 308, leave it.

On JavaScript redirects, Google warns that it might never see one if rendering fails. Use them only if you can't do a server-side or meta refresh redirect.

Should you redirect, canonicalize or let it 404?

These three get mixed up all the time. Use this rule:

  • The page moved and the old URL should stop existing: 301.
  • Both URLs need to stay live, but one is the main version: canonical tag. The canonical tags guide covers this case.
  • The content is gone and nothing replaces it: 404 or 410.

Google's docs say it doesn't index URLs that return a 4xx code. That's what you want for dead content. A 404 is not a failure. A redirect to an unrelated page is.

How do you build a redirect map?

The redirect map is a spreadsheet with two columns: old URL and new URL. It's the most important file in any migration. Build it before launch, not after the traffic drops.

Comparison of a homepage dump and a one-to-one map across link value, landing page, how Google reads it and work needed.Comparison of a homepage dump and a one-to-one map across link value, landing page, how Google reads it and work needed.
The map takes longer up front, but it is the only version that keeps links and visitors.

List every old URL worth saving

Pull URLs from four places, then remove duplicates:

Source What it gives you
A crawl of the live site Every page linked from the site today
Your XML sitemap Pages you told Google about
Google Search Console performance report Pages that get clicks and impressions
Your backlink tool Old URLs other sites still link to

The last source finds pages that no longer appear on your site but still have links. Those are the easiest wins, and most teams miss them. The Search Console guide shows how to export the performance data.

Match each URL with the matching ladder

Work down this ladder for each old URL. Stop at the first rung that fits.

Five-step ladder for mapping old URLs: same URL, same content, closest topic, parent hub, then gone with a 404 or 410.Five-step ladder for mapping old URLs: same URL, same content, closest topic, parent hub, then gone with a 404 or 410.
Work down the ladder for each old URL. A homepage is never a rung.
  1. Same URL. If the path doesn't change, no redirect is needed.
  2. Same content, new URL. The page exists with a new path. Redirect to it.
  3. Closest page on the same topic. The page was merged or rewritten. Redirect to the page that answers the same question.
  4. Parent topic or category. No single match, but a hub page covers it. Redirect there only if a reader would be happy landing on it.
  5. Gone. Nothing on the new site covers the topic. Return a 404 or 410.

Rung five takes discipline. Google's site move guide warns against sending many old URLs to one irrelevant page, such as the home page. It says that may be treated as a soft 404. So a homepage dump gets you the worst of both: no value passed and a confused visitor.

Flatten chains and fix the leftovers

Before launch, check the map against your old redirects. If A already redirects to B, and B now moves to C, point A straight to C. Google's site move guide says to redirect to the final destination directly. If you can't, it says to keep chains to three hops or fewer.

Then sort out the odd cases:

  • Query strings. Decide whether tracking and filter parameters carry over.
  • Trailing slashes and case. Pick one format and redirect the others.
  • http and www. Make sure each variant reaches the final URL in one hop.
  • Pages you're cutting. Thin pages you're removing on purpose are content pruning. The content pruning guide covers when to merge, redirect or delete.

Worked example: mapping a 600-URL site move

Say a B2B startup is moving from an old CMS to a custom Next.js site. The URL structure changes from /resources/blog/post-name to /blog/post-name. Everything here is a worked example with assumed numbers.

Split of 600 old URLs: 62% same content at a new path, 21% merged into a close page, 9% to a hub, 8% gone with a 410.Split of 600 old URLs: 62% same content at a new path, 21% merged into a close page, 9% to a hub, 8% gone with a 410.
Worked example with assumed numbers: most URLs map cleanly, and only a small share should be allowed to die. Worked example from this guide.

The export finds 600 old URLs worth saving. Here's how they land on the ladder:

  • 372 URLs, or 62%, have the same content at a new path.
  • 126 URLs, or 21%, were merged into a closest page on the same topic.
  • 54 URLs, or 9%, go to a parent hub page.
  • 48 URLs, or 8%, are gone and return a 410.

The 410 group gets a second look. Say two of those pages still have links from good sites. Those two get rewritten and redirected instead. The rest stay gone.

Pattern rules cover most of the 62%. One rule sends /resources/blog/:slug to /blog/:slug. The other 228 URLs need one line each in the map. That's an afternoon of work for one person who knows the content.

How do you set up redirects on your stack?

Set redirects as close to the server as you can. Here's how on the stacks I see most.

Next.js and Vercel

In Next.js, use the redirects function in next.config.js. The Next.js redirects docs say permanent: true sends a 308, and permanent: false sends a 307. Google treats 308 like 301, so that's fine.

// next.config.js
module.exports = {
  async redirects() {
    return [
      // pattern rule: covers every old blog URL in one line
      { source: "/resources/blog/:slug", destination: "/blog/:slug", permanent: true },
      // one-to-one rules for merged pages
      { source: "/resources/guides/lead-scoring-101", destination: "/blog/lead-scoring-guide", permanent: true },
      { source: "/pricing-old", destination: "/pricing", permanent: true },
    ];
  },
};

Vercel's configuration redirects docs cap the redirects array at 2,048 rules. Past that, Vercel suggests reading redirects dynamically, for example in middleware. Pattern rules keep most sites well under the cap. For more on this stack, see SEO for Next.js on Vercel.

Shopify

Shopify has a URL redirects screen and a CSV import. Per Shopify's URL redirect help page, standard stores can create up to 100,000 redirects. There's a catch: a redirect only works if the old URL is broken. If a page still loads at that URL, the redirect won't fire. So delete or unpublish the old page first.

Nginx and Apache

On your own server, add rules to the server config. Keep one rule per line and test each one.

location = /pricing-old { return 301 /pricing; }
location ~ ^/resources/blog/(.*)$ { return 301 /blog/$1; }
Redirect 301 /pricing-old /pricing
RedirectMatch 301 ^/resources/blog/(.*)$ /blog/$1

Whatever the stack, the redirect map builder turns a two-column sheet into a Shopify CSV, a Next.js config or vercel.json.

How do you handle a domain move?

A domain move adds one step: Google's Change of Address tool in Search Console. The Change of Address help page says to use it when moving from one domain or subdomain to another. Don't use it for an http to https switch or for moves inside one site.

The page lists what you need first:

  1. A 301 redirect from the old homepage to the new homepage.
  2. Owner access to both the old and new properties in Search Console, with the same Google account.

Once you submit, Google forwards signals for 180 days. The same page says to keep redirects for at least 180 days, and longer if Google still sends traffic to the old URLs.

Everything else is the same as any migration. Build the full map. Redirect every URL, not just the homepage. Update internal links and sitemaps on the new domain.

What should you check after launch?

Launch day is when the checking starts. Run these checks in the first week, then weekly for a month.

Check How What good looks like
Every old URL redirects Crawl the old URL list One hop, then a 200
No chains or loops The same crawl, with redirects followed Zero URLs with 2+ hops
No soft 404s Search Console page indexing report No spike after launch
Internal links updated Crawl the new site No internal links point at redirects
Sitemap lists only new URLs An XML sitemap validator Only final 200 URLs
No leftover blocks Check robots.txt and noindex tags Staging blocks removed
Traffic by page Search Console, old vs new URLs New URLs pick up clicks

The leftover block is the classic launch-day disaster. Google's site move guide reminds you to remove any noindex or robots.txt blocks that were only needed for the migration. The robots.txt guide and the XML sitemap guide cover both files.

Also update internal links to point at final URLs. Redirects catch old links, but your own site shouldn't rely on them. Each internal redirect wastes a little crawl budget and adds a hop for users. The crawl budget guide explains when that starts to matter.

Expect a dip. Google's site move guide says a medium-sized site can take a few weeks or more before Google shows the new URLs. Rankings may move around during that time. A dip that recovers in a month is normal. A drop that keeps falling means something in the map is wrong.

How long should redirects stay in place?

Google's site move guide says to keep redirects as long as possible, generally at least one year. It also suggests keeping them indefinitely for users.

I keep them forever. Redirect rules cost almost nothing to keep. Old links on other sites never update. A partner page from three years ago still sends buyers to your old URL. Remove the redirect and those buyers hit a 404.

Common redirect mistakes

These are the mistakes I see most in a technical SEO review after a migration.

  • Homepage dumps. Hundreds of old URLs sent to the homepage. Google may treat them as soft 404s.
  • Chains. Old redirects pointing to old redirects. Flatten them to one hop.
  • 302s for permanent moves. A weak signal when you meant a strong one.
  • Redirects that drop the path. A pattern rule that sends every old blog post to /blog.
  • No redirects for linked pages. Pages removed years ago that still have backlinks.
  • Staging blocks left live. A noindex tag or robots.txt block shipped to production.
  • Internal links left on old URLs. Every click takes an extra hop.
  • Redirects removed after a year. Old links break, and nobody notices for months.

If old URLs with backlinks are already returning 404s, that's a quick fix. Redirect them now and you recover links you already earned. The link building for startups guide calls these the easiest links you'll ever get. The technical SEO audit guide shows how to find them in a full site review.

What should you do this week?

If a site move is coming, start the map now. If one already happened, run the checks. Either way, it's a few days of work. If you'd rather hand it off, a website relaunch project or New Theory's website services and SEO and AEO services include the full map and the post-launch checks.

FAQ

Do 301 redirects hurt SEO?

A correct 301 to the closest matching page doesn't hurt SEO. Google treats a permanent redirect as a signal that the new URL should be the one it shows. Rankings can wobble for a few weeks while Google recrawls. Trouble comes from redirects to unrelated pages, long chains and old URLs left returning errors.

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

A 301 says the move is permanent, so Google treats it as a strong signal to show the new URL. A 302 says the move is temporary, so Google treats it as a weak signal and may keep showing the old URL. Use 301 or 308 for site moves and 302 or 307 only for short, temporary changes.

How long should I keep 301 redirects?

Google's site move guide says to keep redirects as long as possible, generally at least one year. For domain moves, the Change of Address help page says at least 180 days, longer if Google still sends traffic to the old URLs. I keep them forever. Old links, bookmarks and emails keep pointing at old URLs for years.

Is a 308 redirect the same as a 301 for SEO?

For Google Search, yes. Google's documentation says it treats 308 the same as 301 and 307 the same as 302. The codes differ in how browsers resend the request method. That's why Next.js and Vercel use 308 for permanent redirects by default. You don't need to change them to 301.

Should I redirect deleted pages to the homepage?

No. Google says redirecting many old URLs to one irrelevant page, like the home page, can confuse users and may be treated as a soft 404. Redirect each old URL to its closest match. If nothing on the new site covers that topic, let the URL return a 404 or 410 instead.

How many redirects in a chain will Google follow?

Google's crawlers follow up to 10 redirect hops by default. Google's site move guide still says to redirect straight to the final URL. If you can't, keep chains short, ideally no more than three hops. Every hop also slows the page for users, so flatten chains during every migration.

More like this

Glossary: 404 Error, HTTP Status Codes, Redirect Chain

Startup? Let's talk.

20 minute fit call. You'll leave knowing the first thing we'd fix and roughly what it costs. If we're not the right fit, we'll tell you who is.