How to move a website without losing Google rankings: 301 redirects step by step

In short

Every old address with traffic or links must redirect with a 301 code to its closest equivalent on the new site, not to the home page. Before the move, list all the addresses, prepare a redirect map and test it, and after launch submit the new sitemap in Search Console and watch for errors for a few weeks. When changing domains, use the change of address tool too.

Key points
  • An old address redirects to its closest equivalent, with a 301, without chains.
  • You collect the list of old addresses from the sitemap, Search Console and analytics before changing anything.
  • After launch: a new sitemap, the change of address tool for a new domain and checking 404 errors.
  • Redirects stay forever, and for at least a year.

When this applies to you

  • A new site on a different system, for example moving from WordPress to a static site.
  • A change in the address structure, for example from /offer/websites.html to /services/websites/.
  • A change of domain.
  • Unifying versions: from http to https, or from www to the version without www.

The redirect map

  1. Collect the old addresses

    From the sitemap, from Search Console (pages with impressions and pages with links to them), from analytics and from a tool that crawls the whole site. Don't forget images and PDFs.

  2. Point each one at a new equivalent

    A page on the same topic. It doesn't have to have the same title.

  3. When there's no equivalent

    The closest page by topic. If nothing fits, an honest 404 or 410 error, not a redirect to the home page.

  4. Write the rules on the server

    In the hosting's redirects file or in the server configuration.

  5. Test before launch

    On the test version: every old address should give one 301 redirect and a 200 response at the new address.

Redirects on Netlify (the _redirects file)
# old address                  new address                       code
/offer/websites.html           /services/websites/               301
/blog/*                        /knowledge/:splat                 301
https://www.company.com/*      https://company.com/:splat        301!
Tip

Apache, nginx and other servers have their own equivalents of this file. The principle is the same everywhere: one rule per old address or pattern, straight to the target.

The most common mistakes

Everything to the home page

Google treats mass redirects to an unrelated page much like a 404 error, so the old rankings are lost anyway.

Redirect chains

A leads to B, and B to C. It slows the site down and makes things harder for crawlers. Always point straight at the target address.

302 instead of 301

302 means a temporary change. For a permanent change of address, use 301 or 308.

Forgotten images and PDFs

They also get search traffic and links from other sites.

Redirects removed after a month

Google recommends keeping them for at least a year, and ideally forever.

noindex carried over from the test version

Test versions often block indexing. Copied to production, it removes the whole site from Google.

After launch

Checklist0 of 6

Terms from this guide

301 redirect

The server's response saying a page has permanently changed its address. The browser and Google go to the new address and transfer the old one's value to it.

Questions and answers

How long should redirects be kept?

Google recommends at least a year, and ideally forever. Keeping a few rules costs nothing, and old links from other sites keep working for years.

Will I lose my Google rankings?

With a good redirect map, rankings usually fluctuate for a while and come back. Large, lasting drops almost always come from missing redirects, heavily changed content or a forgotten indexing block.

Does a 301 redirect pass on the value of links?

Yes. Google treats a permanent redirect as a strong signal that the new address replaces the old one.

Sources and documentation

The service related to this guide

Websites for companies

Describe the problem

Question 1 of 5

What would you most like to improve?

Pick the closest one. It doesn't have to fit perfectly.

First summary

This is a first suggestion based on a few answers, not a diagnosis. Nothing is saved until you send the message.