Redirects are where website migrations lose the most value. Every old address that people have bookmarked, shared or linked to needs to send them, and search engines, to the closest new page in a single step. Miss one and its visitors hit a dead end. Send it somewhere vague and its rankings may not follow.
When we moved our website from Lovable to Claude Code, we launched with 71 permanent redirects. In the days after, real traffic showed us gaps we hadn't planned for, and the site now has 111 redirect rules, every one of them tested. This guide is the process we would follow again. The rest of the move is in our Lovable to Claude Code migration guide.
In this article · 09 sections
Build the list of old addresses
You can't redirect what you haven't listed. Google's site move guide suggests gathering old URLs from your sitemaps, server logs, analytics, your CMS and the links report in Search Console. We added two more sources:
- 01Search Console's page indexing report, which lists addresses Google knows about, including ones you have forgotten.
- 02Your previous platforms. Our site had been on Wix before Lovable. Wix's old sitemap files, blog feed, member profiles and blog pages were still being requested years later.
If you are working in Claude Code, ask it to collect these into one list and remove duplicates. That list is your migration contract: every address on it must end up somewhere sensible.
Map each address to its closest page
For each old address, pick the new page that best answers the same need. An old service page goes to the new service page, and an old article to its new address. Google advises against sending lots of old addresses to one unrelated page, such as the home page, so don't make the home page a catch-all.
Some of these are judgement calls. Two of the redirects Lovable already had now go to our Insights section, because it didn't exist before and was the closest match. Claude Code can draft the map quickly, but check it yourself. You know which pages are close enough and which aren't.
Choose the right response
Each line needs a response code, and the choice matters:
| Response | When to use it | What Google does |
|---|---|---|
| 301 or 308, permanent | The page has moved for good | Treats it as a strong signal to use the new address |
| 302 or 307, temporary | The page will come back | Treats it as a weak signal, and may keep the old address |
| 410, gone | You removed the content on purpose | Treats it like a 404: the page is dropped from the index |
| 404, not found | The address never existed | Drops it from the index, and crawls it less over time |
Google's documentation on HTTP status codes says it treats all 4xx errors except 429 the same way, so 410 isn't faster than 404 in Google. We use 410 for content we chose not to move, such as Wix's old tag pages, because it tells anyone reading the response that the removal was deliberate.
Send each address to its final page in one hop. Google's crawlers follow up to 10 redirects in a row, but every extra hop adds a delay, and chains are easy to break later.
Every old address should reach its closest new page in one permanent redirect. Never make the home page a catch-all.
Catch the near misses
A redirect list matches exact addresses. Real traffic doesn't. These three caught us out after launch:
- 01Capital letters. Lovable treated /Services/Growth-Strategy and /services/growth-strategy as the same page. Cloudflare, our new host, doesn't. Our "Page not found" page now retries any address in lowercase.
- 02Trailing slashes. Some of our own links ended in a slash, which cost every click an extra redirect. Fix your internal links rather than relying on redirects.
- 03Files from the old platform. Images uploaded to Lovable had addresses of their own. We answer those with "gone", because the new site doesn't use them.
Check your host's analytics for "not found" responses in the first days after launch. We saw more than 500 in Cloudflare, and they pointed us to most of these gaps. The full list of what we fixed is in our post-migration checklist.
Test every line
Don't test a sample. Ask Claude Code to request every old address on a local copy of the site and report three things for each: the response code, where it ends up, and how many hops it took. Then ask it to fail loudly on anything unexpected.
We tested all 111 rules on a local copy of Cloudflare Pages before they went live. A second check caught three rules that broke on a trailing slash. Testing is the cheapest step in the whole migration, and it is where the expensive mistakes are found.
Launch, then watch
After launch:
- 01Keep the redirects. Google recommends keeping them for at least a year, and keeping them indefinitely is better. They cost almost nothing.
- 02Update your own links. Point internal links, and the most important links from other sites you control, straight at the new addresses.
- 03Submit the new sitemap. Google suggests keeping a sitemap of the old addresses too, which helps you track the move in Search Console.
- 04Expect movement. For a medium-sized site, Google says new addresses can take a few weeks or more to appear in results, and rankings may move around meanwhile.
Fix new 404s as they appear for the first eight weeks. A sitemap that tells search engines exactly what changed helps too. Our guide to llms.txt and sitemaps covers how we generate ours. If your old site was built in the browser, check what crawlers see on the new one, as our Lovable SEO guide explains.
A migration is a good time to fix your organic SEO foundations as well as move them. If you'd like help planning yours, book a call below.
How long should I keep redirects after a migration?
Google recommends at least a year, and says keeping them indefinitely is a good idea. Redirects are cheap to keep, and links to old addresses can carry on bringing visitors for years.
Should I use a 301 or a 308 redirect?
Either, for a permanent move. Google treats 308 the same as 301, so use whichever your host supports. Use a temporary 302 or 307 only if the old page is coming back.
Do redirects lose rankings?
Google states that 301 and other permanent redirects don't cause a loss in PageRank. Rankings can still move for a few weeks after a migration while Google processes the new addresses, which is why testing every redirect before launch matters.
“Redirects are where website migrations lose the most value. Map every old address, send each one to its closest new page in one hop, and test every line.”
Copy post gives you the takeaway and the link, ready to paste into LinkedIn.Lawford, A. (24 November 2026). How to plan and test redirects in a website migration. Refiner Agency. https://refineragency.com/insights/website-migration-redirects
