Free, independent guides since 2010

SEO

Moving a website without losing rankings

How to migrate a website to a new domain, CMS or URL structure without losing traffic: URL mapping, 301 redirects, testing, Search Console and what to check afterwards.

<guide section="SEO" type="article" read="2 min"/>

A new design, a new CMS, a new domain or simply cleaner URLs: sooner or later most websites move. Done carelessly, a migration can wipe out years of search engine rankings overnight. Done well, visitors and search engines hardly notice. This very site moved from WordPress to a static setup with new URLs, so we practise what we preach.

Step 1: inventory every URL

Collect all URLs of the old site: from your XML sitemap, a crawl with an SEO spider, your analytics (pages with traffic) and your backlink data (pages with links). Do not forget images, PDFs and old URLs that already redirect.

Step 2: map old to new

Create a simple spreadsheet with two columns: old URL and new URL. Every old page should point to the most relevant new page. Redirecting everything to the homepage is treated by search engines as a “soft 404” and throws away the value of those pages.

Step 3: set up 301 redirects

How you add redirects depends on your hosting:

PlatformHow
Apache (most shared hosting)Redirect 301 or RewriteRule lines in .htaccess
Nginxreturn 301 rules in the server configuration
Static hosts and CDNsA _redirects file or redirect rules in the dashboard
WordPressA redirect plugin, or server rules for better performance
Plain text
# .htaccess (Apache)
Redirect 301 /blog/old-post/ https://www.example.com/new-post

# _redirects (many static hosts)
/blog/old-post/  /new-post  301

Avoid redirect chains (A → B → C): point every old URL directly at its final destination. And keep canonical tags and internal links pointing to the new URLs.

Step 4: test before and after launch

  • Run your list of old URLs through a redirect checker or crawler: every one should return a single 301 and end on a 200 page.
  • Check that the new site is not blocked by robots.txt or a “noindex” left over from the staging site.
  • Submit the new XML sitemap in Google Search Console, and use its change of address tool when you move to a new domain.

Step 5: monitor

For the first weeks, check daily for 404 errors in Search Console and your server logs, and watch your traffic per page. Fix missing redirects as soon as you find them. Keep the redirects in place for at least a year – preferably forever, because old links on other websites never disappear.

Frequently asked questions

How long does it take for rankings to recover after a migration?

With good one-to-one redirects many sites see little or no drop, and fluctuations settle within a few weeks. Big structural changes, a new domain and content changes at the same time take longer.

Should I use 301 or 302 redirects?

Use 301 (or 308) for permanent moves. 302 and 307 mean temporary and are meant for situations where the old URL will come back.