Astro / SEO and AI search
Keep your rankings when you relaunch
Map every old URL to its new page with 301 redirects in netlify.toml, test them, and monitor Google after launch so you keep your traffic.
Intermediate 20 min Updated
A relaunch is the moment many websites lose years of search traffic. Old addresses stop working, Google finds error pages instead of content, and links from other sites lead nowhere. This article is for anyone moving to a new Viralistic Astro site from WordPress, Webflow or an older version. You will learn how to list your old URLs, redirect each one to the right new page and check the result after launch.
Why redirects matter
A 301 redirect tells browsers and search engines that a page has moved permanently. Visitors land on the new page, and search engines transfer most of the old page’s ranking signals to the new address. Without a redirect, the old URL returns a 404 error, and over time it drops out of search results.
List every old URL
Do this before the old site goes offline.
- Download the old site’s sitemap, usually at
/sitemap.xml. - In Google Search Console, export the pages that received clicks over the longest period available.
- Export pages with links from other websites, from the Links report in Search Console or an SEO tool.
- Crawl the old site with a website crawler to catch pages missing from the sitemap.
- Combine everything in one spreadsheet with three columns: old URL, new URL and status.
Tip: Do not forget PDFs, images that other sites link to, and old campaign landing pages. They often have more backlinks than you expect.
Map old pages to new pages
- Map each old URL to the most relevant new page. A blog post goes to the same post, a service to the matching service.
- If there is no direct equivalent, choose the closest parent page, such as the overview of all cases.
- Do not send everything to the home page. Search engines treat that as a missing page anyway.
- Use one wildcard rule for a whole group of old URLs when they all go to the same place.
Add redirects in netlify.toml
Viralistic sites keep all redirects in netlify.toml at the root of the project, so they are real server redirects and live in one place.
# One old page to one new page
[[redirects]]
from = "/about-us"
to = "/about"
status = 301
# A specific old project first
[[redirects]]
from = "/wf-projects/silverdrive"
to = "/cases/silverdrive"
status = 301
# Then everything else in that old folder
[[redirects]]
from = "/wf-projects/*"
to = "/cases"
status = 301
Two Netlify rules to remember:
- Order matters. Netlify uses the first rule that matches, so put specific rules above wildcard rules.
- Existing files win by default. If a page still exists at the old address, the redirect is ignored. Add
force = trueto a rule when it must always apply, as with redirectingwwwto your main domain.
[[redirects]]
from = "https://www.example.com/*"
to = "https://example.com/:splat"
status = 301
force = true
The :splat part carries over whatever matched the *, so www.example.com/contact goes to example.com/contact.
Test before you launch
- Open the deploy preview of the new site and try a handful of old paths from your spreadsheet.
- After launch, check the response of any old URL from a terminal:
curl -I https://example.com/about-us
- Look for a
301status and alocationheader with the new address. - Make sure there are no chains (old to older to new) and no loops.
- Update links inside the new site so they point straight to the new URLs instead of relying on redirects.
After launch
- Submit the new sitemap in Google Search Console.
- Check the indexing report weekly for the first month. Add redirects for any old URL that shows up as not found.
- If your domain changed, keep the old domain connected to Netlify so its redirects keep working, and use the change of address tool in Search Console.
- Keep redirects for at least a year. In practice, leave them in place: they cost nothing.
Note: Some movement in rankings during the first weeks after a relaunch is normal while Google processes the changes. A steady decline after a month means something is missing, usually redirects.
If you are planning a relaunch and want the migration handled for you, book a strategic call: https://calendly.com/marrallisa/30min
Next steps
Still stuck?
Send us what you tried and a screenshot, and we will help you further. For new projects, book a strategic call.
Strategic call