Skip to content
AE DIGITAL
Technical SEOBy 6 min read

301 redirect mapping for a new website: method, tools and checks

How to collect every URL of the old site, match them to the new ones, avoid chains and loops, implement 301 redirects and monitor for three months that traffic holds.

Article cover: the word “301” next to a glowing icon on a violet space background

Why a new website loses traffic

When a site is rebuilt, page addresses almost always change: /products/red-shoe.html becomes /shop/red-shoe, categories get renamed, blog posts lose the date in their path. For Google, the old URLs are ranking pages with external links and a click history. If they return 404 after launch, that work is lost and the new pages start almost from scratch.

A 301 redirect is the server response that says "this page has moved permanently, here". Google treats the target of a 301 or 308 as the canonical URL and, according to its documentation, permanent redirects do not lose PageRank. Redirect mapping is therefore the most important SEO part of a migration, and also the part most often done on the last day or skipped.

Even with a correct map, Google says a move can take a few weeks or more for a medium-sized site, with temporary ranking fluctuations. Without a map, the loss is structural.

Collecting every existing URL

The map is only as good as the starting list. One source is not enough, because each one sees part of the site.

Sources to combine

  • A crawl of the current site with a tool such as Screaming Frog: pages reachable through internal links, with status and canonical.
  • Current XML sitemaps, which often contain pages no longer linked.
  • Search Console, Performance report, export by page: URLs that received clicks and impressions in the last 16 months.
  • Search Console, Links report: the pages most linked from other sites.
  • GA4 landing pages: URLs that bring sessions and conversions.
  • Server logs, if available: URLs requested by Googlebot, including PDFs and images.

Setting priorities

Merge everything into one sheet, remove duplicates and add organic clicks, backlinks and conversions for each URL. The top 100 to 200 rows by value should be mapped by hand, one by one. The rest can be handled with rules, as long as every URL has a decided destination.

Matching old and new URLs

The working sheet has a few columns: old URL, current status, clicks, backlinks, new URL, match type, notes. There are three matching criteria:

  1. Direct equivalent: the same page at a new address. This is the ideal case.
  2. Closest page by content: a deleted product goes to the category that contained it or to the model that replaces it, not to the homepage.
  3. No equivalent: the page returns 404 or 410. Google advises against redirecting many old pages to an irrelevant page such as the homepage.

When the change follows a pattern, one rule covers hundreds of rows. For example, if posts move from /blog/2023/05/title to /blog/title, one regular expression is enough. Before writing rules, settle the conventions: trailing slash or not, lowercase, www or not, HTTPS. Every inconsistency here creates an extra redirect.

Redirect chains and loops to avoid

A chain is a redirect that leads to another redirect: A goes to B, B goes to C. It happens often on sites that have already been migrated once, because old redirects point to URLs that are now being moved again. Google recommends redirecting straight to the final URL; if that is not possible, ideally no more than 3 hops and in any case fewer than 5. Googlebot follows up to 10.

A loop is the worst case: A goes to B and B goes back to A, and the page never loads. To avoid both:

  • export existing redirects and update them so they point to the final new URLs;
  • check that no destination URL also appears in the old URL column;
  • test the full map on a staging environment before launch.

Implementation by platform

Shopify

In Shopify, redirects live under Content > Menus > URL redirects, with CSV import using the "Redirect from" and "Redirect to" columns. A standard store can have up to 100,000 redirects. Two limits to know: a redirect only works if the old URL has no active page, and some fixed paths such as /products or /collections cannot be redirected. Stores with several markets in subfolders need a redirect for each version, for example /en-ca/.

Apache and WordPress

On Apache, and therefore on many WordPress hosts, you use the .htaccess file with mod_alias directives: Redirect 301 /old-page /new-page for single URLs and RedirectMatch 301 for rules with regular expressions. A redirect plugin is fine for a few dozen rows; for thousands it is better to work at server level.

Nginx

On Nginx you use return 301 inside a location block, or a map directive to handle long lists cleanly. Either way, the redirect must be server-side: Google only follows JavaScript redirects if rendering succeeds.

Checks after launch

On launch day, as soon as the new site is live:

  1. Run the full list of old URLs through a crawler in list mode: each one must return 301 and land on a 200 page in a single hop.
  2. Check that new pages have a self-referencing canonical, no noindex left over from staging, and a robots.txt that does not block the site.
  3. Update internal links and sitemaps to the new URLs: internal links should not go through redirects.
  4. Submit the new sitemap in Search Console and run URL Inspection on the 10 to 20 most important pages.
  5. If the domain also changed, use the Change of Address tool; for moves within the same domain it is not needed.

Monitoring for three months

The first weeks show whether the map holds. A weekly routine for the first three months:

  • Search Console Pages report: "Not found (404)" entries reveal old URLs missing from the map. "Page with redirect" for old URLs is normal. How to read these reports is covered in our Google Search Console guide.
  • Performance by page group: compare clicks for categories, products and articles with the same period before launch.
  • 404 errors on the site: server logs or a GA4 event on the 404 page reveal old URLs to add to the map.
  • Top backlinks: ask the sites that link to you most to update the link to the new URL.

After three months, do not dismantle the map. Google recommends keeping redirects for at least a year, and it is worth keeping them longer because external links and bookmarks keep using the old URLs.

If the migration is also a platform change, our WooCommerce to Shopify migration checklist covers products, customers and orders, while the infrastructure side is in our article on zero-downtime ecommerce migration. For Shopify stores there is also the Shopify technical SEO guide. If you are rebuilding your site and want us to prepare and check the redirect map, get in touch.

Frequently asked questions

How long should 301 redirects stay in place after a migration?

Google recommends at least a year, and it is worth keeping them longer: external links, bookmarks and old emails keep using the previous URLs even after Google has updated its index.

Can I redirect all deleted pages to the homepage?

Better not. Google advises against redirecting many old pages to an irrelevant page such as the homepage. Use the closest page by content, such as the category, or return a 404 or 410.

301 or 302 redirects when rebuilding a site?

A permanent move needs a permanent redirect, 301 or 308. Google uses the target as the canonical URL. A 302 is temporary and keeps the source URL in search results.

Why does a Shopify redirect not work?

The most common causes are an active page still living at the old URL, a fixed path such as /products or /collections that cannot be redirected, or a typo in one of the two fields.

Sources

  1. Site moves with URL changes — Google Search Central
  2. Redirects and Google Search — Google Search Central
  3. URL redirects — Shopify Help Center
  4. Apache module mod_alias — Apache HTTP Server Project
  5. Module ngx_http_rewrite_module — nginx
  6. 301 Moved Permanently — MDN Web Docs

Related articles

Tell us what isn't working.

We reply within one business day with a first opinion and, if it makes sense, a quote.

Write to us