Skip to content

Attract and measure

Website migration without lost URLs: redirects and validation

Inventory your URLs, decide where each one goes and validate 301 redirects before and after a website migration. Includes a decision tree and a CSV map.

In this guide
A hand linking a faded old sitemap to a sharp new one with green thread, node by node.

A migration does not end the day the new site opens. It ends when every old address leads where it should: the product page that used to come from Google, the technical PDF a distributor linked to, the landing page of a campaign that is still running. Without that control, when you change platform, catalog or domain, those URLs return "page not found" and nobody notices until inquiries drop.

The method has four parts: inventory, a decision per URL, redirects and validation. It does not promise to keep your Google rankings; it keeps you from carelessly losing visits and signals that can be protected.

When URLs change

For Google Search Central, it is any change to the address of pages that already exist. There are three common cases: moving from HTTP to HTTPS, changing domains or merging several, and changing paths, for example from /index.php?id=17 to /products/industrial-grease. A redesign that changes CMS almost always falls into the third case, even if the domain stays the same. Changing servers or DNS without touching URLs is a different problem and is outside this guide. Google also asks you to change one thing at a time: if you are moving domain, CMS and design, do it in stages so you know what caused a problem.

The inventory comes from the current site

The map is built from what exists today, not from the new site's menu: what is not in the menu is often exactly what has external links or campaign visits. Google suggests four sources for finding the important URLs: your current sitemaps, which usually hold what you already submitted to Search Console; server logs or analytics, over a period that covers your seasonality; the Search Console links report, which shows pages with internal and external links; and the CMS, which can usually export every URL with content. It also asks you to include embedded content, such as images, videos, JavaScript and CSS, because those URLs move just like the rest. Apply the same criterion to technical sheets, safety data sheets and PDF catalogs.

Add the destinations of active ads and the URLs printed in catalogs, email signatures or QR codes: you are not going to reprint the catalog, but its QR code still has to lead somewhere useful.

One decision for each old URL

"Whatever has no equivalent goes to the home page" is not a decision. Google warns that sending many old URLs to a single irrelevant page, such as the home page, confuses people and may be treated as a soft 404: a response that looks correct but does not deliver the content people were looking for.

Old URL situationDecisionResponse
The same content exists at another addressRedirect to the equivalent URL301 or 308
Several pages were merged into oneRedirect them all to the consolidated page301 or 308
The content is not moving to the new site and has no replacementDo not redirect404 or 410
Discontinued product with an alternative that truly replaces itRedirect to the alternative; if it does not replace it, 404 or 410 with a helpful error page301/308 or 404/410
The URL does not changeKeep it and check that it responds200

There is one control question: if someone arrives through the old URL, do they find what they expected? When the answer is "sort of", write down the reason and who decided; the sales team usually knows which item replaces which. The redirect map that comes with this guide has columns for the old URL, its source, the decision, the destination, the reason and validation.

What the redirects should look like

Google distinguishes two families. Permanent redirects (301 and 308) indicate that the target should be treated as the canonical URL and shown in results; temporary ones (302, 303 and 307) do not send that signal, and the old URL may keep appearing. A definitive change calls for permanent redirects. Google treats 301 and 308 the same way, and permanent redirects do not cause a loss in PageRank.

Set them up on the server or in the CMS; Google leaves JavaScript redirects as a last resort, because they may go unnoticed if the page is not rendered properly. Avoid chains. Googlebot follows up to 10 hops, but the recommendation is to go straight to the final destination or, if that is not possible, ideally no more than 3; each hop adds latency for visitors. If there are redirects left from an earlier migration, update them to point to the new destination. And keep them as long as possible, generally at least one year; with people in mind, Google suggests considering keeping them indefinitely.

The Search Console Change of Address tool only applies if you change domain or subdomain. You do not need it to move to HTTPS, to switch between www and non-www, or to move paths within the same domain.

Redirects do not fix everything. On the new site, canonical and hreflang must use the new URLs, and menus, product pages and buttons should link straight to them. Among the common mistakes Google lists is launching with the robots.txt or noindex that blocked the site during development: prepare the final robots.txt in advance, the list of pages where noindex will be removed, and one sitemap of new URLs and another of the old ones.

Validate before, during and after

In the staging environment, run the whole map through a script or crawler and record, for each old URL, the response code, the final destination and the number of hops. Any destination that returns 404, ends on the home page without that being decided or has more hops than agreed is an error. On the new URLs, check canonical, that indexing is allowed and that they appear in the sitemap.

On launch day, repeat the test in production, because a server or CDN rule can change the result. Manually check the priority URLs (highest traffic, campaign destinations and the most downloaded PDFs), submit the new sitemap in Search Console and update the destinations of ads and profiles.

In the following weeks, watch Search Console and the logs for spikes in "not found" or other errors. Google suggests submitting both sitemaps: indexed pages from the old one should drop and those from the new one should rise; redirect warnings on the old one are normal. For a medium-sized site it can take a few weeks or more for the new URLs to appear, and visibility may fluctuate in the meantime. A drop in the first few days does not prove an error; a sustained rise in errors does call for a review.

An invented case: the distributor that changed CMS

This is not a RealStack or client case; the data is invented. An industrial parts distributor moves to a new CMS without changing domain. Its product pages had addresses like /index.php?id_producto=482 and move to /products/bearing-6205.

The inventory gathers 1,140 URLs, including 610 product pages and 380 technical PDFs. Cross-checking logs with the links report turns up 45 PDFs that were not in the menu and had links from customers' sites. The team decides on 560 redirects to equivalent product pages and 30 consolidations by product family; the 20 products with no replacement return 410 with an error page offering search and the catalog, and news items with no commercial value return 404. Nothing is sent in bulk to the home page.

In production, 70 URLs show two hops left over from an earlier move to HTTPS, and they are fixed. Two weeks later, Search Console shows 404s for a group of PDFs that were uploaded under different names. Because every row of the map has the old URL, the decision and an owner, the cause turns up quickly.

Before launching the migration

  • The inventory includes sitemaps, logs, links, CMS, files and campaigns, not just the menu.
  • Every old URL has a written decision, and no bulk redirect points to the home page without justification.
  • Redirects are permanent, set on the server or CMS, and go straight to the destination, with no inherited chains.
  • Canonical, hreflang, internal links and sitemap use the new URLs.
  • The final robots.txt and the list of noindex rules to remove are ready.
  • The map test ran in staging, will be repeated in production, and someone owns watching Search Console afterwards.
  • How long redirects stay is agreed in writing: at least one year, not a few months to "clean up" the server.

What this method does not cover

It protects what already exists. It does not define the new site's content or your buyers' search intent, and it does not guarantee that you keep your rankings. If a vendor runs the migration, ask for the map and the validation test as part of the delivery.

Related guides

  • SEO for a B2B Catalog: How to Answer Your Buyers' Questions https://realstack.tech/en/knowledge/b2b-catalog-seo-answer-buyer-questions
  • Core Web Vitals for a B2B website: what to measure before redesigning https://realstack.tech/en/knowledge/core-web-vitals-for-a-b2b-website
  • From campaign to sale: what to measure and how to connect the journey https://realstack.tech/en/knowledge/from-campaign-to-sale-what-to-measure-and-connect
  • What a landing page needs to receive leads from Google Ads https://realstack.tech/en/knowledge/what-a-landing-page-needs-for-google-ads-leads
  • Growth: SEO, ads and sales follow-up https://realstack.tech/en/growth

Bring it to your business

Website migration redirect map

A CSV template to decide and check what happens to every URL on your current site when you change platforms, structure or domain. It helps make sure no old address is left without a decision, and lets you test, before and after launch, that each one returns what you agreed.

View resource
Should I use 301 or 308?

For Google they have the same effect: both are permanent. Use whichever your server or CMS configures reliably, always server-side and straight to the final destination.

How long should I keep the redirects?

As long as possible: generally at least one year, according to Google, which suggests considering keeping them indefinitely. Agree on it in writing with whoever manages the site.

Can I redirect discontinued products to the home page?

It is not recommended. Google warns that redirecting many URLs to an irrelevant page, such as the home page, may be treated as a soft 404. Redirect only if there is an alternative that truly replaces the product; otherwise, return 404 or 410 with a helpful error page.

Do I need the Search Console Change of Address tool?

Only if you change domain or subdomain. You do not need it to move to HTTPS, to switch between www and non-www, or to reorganize paths within the same domain.

Authorship and sources

Author: Andrés Florez · RealStack