301 redirects after a website change: don’t lose your rankings

How to keep your Google rankings after changing your website or domain: a URL map, 301 redirects, an .htaccess example, Search Console and checking for 404 errors.

Illustration: two websites connected by a curved arrow, with a board listing addresses between them and a mark showing the change was completed successfully
AI-generated illustration

A new website means new page addresses, but Google only knows the old ones. If you don’t show where they are now, customers and the search engine will land on a 404 error, and rankings built over years will start to drop. The solution is 301 redirects.

In this guide I show how to plan and implement them step by step: from a URL map, through an example for Apache, to checking in Search Console. All you need is a spreadsheet, access to the server and a few hours of work.

What a 301 redirect is and when you need it

A 301 redirect is an instruction from the server: “this page has moved permanently to this address.” The browser immediately opens the new address, and the search engine transfers the information about the old one to it.

You need it when you:

  • change your domain (e.g., from firma.com.pl to firma.pl),
  • move to a new system, e.g., from WordPress to custom code,
  • change the URL structure (e.g., /oferta/tarasy to /uslugi/tarasy),
  • switch from http to https or from www to the version without www,
  • merge or remove pages.

If the addresses stay exactly the same, redirects are not needed. That’s a common reason why a well-executed redesign doesn’t hurt rankings.

Step 1: collect a list of old addresses

Before you switch off the old website, take an inventory of it. You need every address that may get visits from Google or from other websites.

Sources for the list:

  1. The sitemap of the old website (usually twojadomena.pl/sitemap.xml).
  2. Google Search Console: the Performance report shows the addresses that get clicks. Export it to a spreadsheet.
  3. Google Analytics (GA4): the pages that customers visit.
  4. A website crawling tool, if your website has no sitemap.

Put everything in a spreadsheet, in a single column. Mark the addresses with the most visits as a priority: they carry the most risk.

Step 2: map old addresses to new ones

This is the most important part of the job. Next to each old address, enter the new one with the closest content.

Old address New address
/oferta/tarasy /uslugi/tarasy
/o-nas.html /o-firmie
/blog/jak-wybrac-plytki /porady/jak-wybrac-plytki
/stary-produkt-xyz /kategoria/podobne-produkty

Rules:

  • one old address goes to the one best-matching new address,
  • if a page no longer exists and has no equivalent, choose the closest category or leave a 404 error (or 410, meaning “permanently removed”),
  • include addresses with parameters if they were indexed,
  • decide whether the final address ends with a trailing slash, and stick to it everywhere.

On a large website the map may have several hundred rows. It’s worth making it in a spreadsheet, because later you’ll use it for testing.

Step 3: implement 301 redirects

How you implement them depends on the server. Below is an example for Apache, the popular shared hosting setup with an .htaccess file in the root directory. Other servers write this differently: Nginx has its own syntax in its configuration, and WordPress, Shopify and other systems usually have a plugin or a setting in the admin panel. If you don’t know what your website runs on, ask your host or your contractor.

Individual addresses:

Redirect 301 /oferta/tarasy https://twojadomena.pl/uslugi/tarasy
Redirect 301 /o-nas.html https://twojadomena.pl/o-firmie

The whole domain to a new one (the old addresses stay the same, only the domain changes):

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?staradomena\.pl$ [NC]
RewriteRule ^(.*)$ https://nowadomena.pl/$1 [R=301,L]

Before saving the file, make a copy of it. An error in a single character can take the whole website down. If a 500 error appears after the change, restore the copy and fix the entry.

Also remember to standardize the address version: http and https, with www and without www should all lead to one version, and with a single redirect.

Step 4: avoid two common mistakes

Everything to the home page

The temptation is strong: one rule and “job done.” But a customer looking for terraces who lands on the home page usually leaves. In its documentation on site moves, Google recommends redirecting to the corresponding pages, and mass redirects to the home page may be treated as a soft 404 error. Redirect every address to where the same content is.

Redirect chains

A chain is when address A leads to B, B to C, and C to D. Each hop adds a delay, and if the chain is too long, Googlebot may stop following it. Chains usually appear when someone adds new rules on top of old ones without fixing the previous ones.

The rule: every old address leads directly to the final one. If you already have rules from a previous website change, fix them so they point to the new target address.

Step 5: Search Console and a new sitemap

After implementation, make sure Google learns about the changes quickly.

  1. Add a new property in Google Search Console if you’re changing the domain. Keep access to the old domain as well.
  2. Use the Change of Address tool in the old property’s settings if you’re changing the domain. It requires 301 redirects that already work.
  3. Submit a new sitemap (sitemap.xml) with the new addresses. Don’t put old addresses that now only redirect in it.
  4. With a bigger change, keep the old sitemap in Search Console for a while. In the Sitemaps report you’ll see the number of indexed old addresses drop to zero.
  5. Check a few important addresses with the URL Inspection tool.

I handle the sitemap and the submission to Google and Bing in my Submission to Google and Bing service. I describe how to read the reports after the change in the guide on Google Search Console.

Step 6: check the website after implementation

Don’t assume everything works. Test it.

  • Paste a few dozen addresses from the map into the browser and check that the right page opens.
  • Check the response code (301, not 302) using the browser’s developer tools, Network tab, or a free redirect checker.
  • Crawl the website with an SEO audit program and look for 404 errors and chains.
  • Look at the Page indexing report in Search Console after a few days: 404 errors and redirected addresses will show up there.
  • Check the results in GA4: traffic to key pages shouldn’t suddenly disappear.

In the first two weeks, look at the reports every few days. Fix new 404 errors right away: add the missing redirect.

The redirect works, but it’s worth pointing everyone to the new address directly.

  • Google Business Profile: change the website address when editing the profile.
  • Business directories and social media: update the link on Facebook, Instagram, LinkedIn and in directory listings (see business directories in Poland).
  • Email signature, business cards, invoices, flyers.
  • Ads on Google Ads and elsewhere: the ads’ final URLs should lead straight to the new pages.
  • Partner websites that link to you: ask them to change the important links.

Changing the address in your Business Profile is quick, and it helps, because customers from Maps land straight on the right page.

Checklist for launch day

  1. A backup of the old website and of the .htaccess file.
  2. A spreadsheet with the map of old and new addresses.
  3. 301 redirects implemented and tested on a sample.
  4. One version of the domain (https, with www or without).
  5. New sitemap submitted in Search Console.
  6. Change of address in Search Console, if you’re changing the domain.
  7. Updated link in your Business Profile and in directories.
  8. A crawl of the website for 404s and chains.
  9. Report checks after 3, 7 and 14 days.

Summary

When you change a website, the biggest risk is the addresses nobody remembered. A map of old and new addresses, 301 redirects to the corresponding pages and checking for 404s after launch protect what Google knows about your website.

If you’re planning a website change and don’t want to risk your rankings, see my website redesign service: I move content and addresses without losing SEO. You can also write to me, and I’ll prepare a quote within 24 hours.

Frequently asked questions

Related services

Have a similar project?

Describe what you need and I’ll send a quote within 24 hours. New clients get 20% off their first project.

Get a quoteBook a call (20 min)

Read more