Short verdict: Never redirect every removed URL to your home page, and never rely solely on HTML meta-refresh previews to validate redirects. Map each retired address to either a real equivalent (
HTTP 301) or an honest404/410, test both trailing-slash and slashless variants in the hosting runtime, and verify the live host after release.
A website can change its purpose while readers still arrive through old bookmarks, search results and links from other sites. When we rebuilt the INHUVESA site, we had three distinct jobs to do: keep the core editorial pages alive, redirect readers from old entry points to the pages that replaced them, and retire 33 former corporate and service addresses cleanly. Here is how we structured, implemented and checked those changes before release.
Map the old URLs before deleting files
Start with an inventory of every address people or crawlers might still request. Previous sitemaps, internal links, Google Search Console and Bing Webmaster Tools page exports, and server logs all help build the complete list. For each address, record four facts: what the old page offered, whether an equivalent exists, the destination URL, and the exact HTTP status you expect.
Check aliases from earlier versions of the site and both trailing-slash forms (/page/ and /page) where they were used. A concise migration sheet looks like this:
| Old URL | Former purpose | Equivalent exists? | Expected response | Destination |
|---|---|---|---|---|
/old-guide/ |
Guide replaced by a newer one | Yes | 301 |
/guides/new-guide/ |
/blog/ |
Section merged into the main index | Yes (consolidated) | 301 |
/articles/ |
/legacy-directory/ |
Directory moved to another site | Yes (moved section) | 301 |
External archive section (#archive) |
/services/legacy-offer/ |
Commercial service listing | No (offer ended) | 404 or 410 |
None (serve a styled 404 page) |
Use a permanent redirect (HTTP 301) when the reader can get the same information at a new address, or when several overlapping pages have been consolidated into one broader resource. When an offer or section has ended with no real substitute, return 404 or 410 rather than forcing visitors onto the home page — search engines treat mass redirects to unrelated pages as soft 404s, and visitors lose context immediately. See Google Search Central on URL changes.
Check the response the host will actually send
A local framework preview does not always send the same HTTP response as your production host. Our Astro preview represents redirects with a small HTML page containing a <meta http-equiv="refresh"> tag that instructs the browser to visit the destination after receiving an initial 200 status. Browsers follow it, but crawlers and HTTP tests need real 301 status headers from the hosting layer. See the Astro routing documentation.
On Cloudflare Workers with Static Assets, permanent redirects belong in the _redirects file inside the build output (dist/_redirects). Generating _redirects directly from the same URL map that drives preview routes guarantees every old address has one canonical destination to maintain. See Cloudflare static asset redirects.
# Cloudflare Workers Static Assets / Netlify (_redirects)
/old-guide/ /guides/new-guide/ 301
/old-guide /guides/new-guide/ 301
/blog/ /articles/ 301
/blog /articles/ 301
If you self-host static files behind NGINX instead, express the same rules as exact location = blocks so you avoid regex loops:
location = /old-guide/ { return 301 /guides/new-guide/; }
location = /old-guide { return 301 /guides/new-guide/; }
Four common migration mistakes to avoid
- Redirect chains (
A → B → C): Always point legacy URLs directly to the final destination (A → C), even ifApreviously redirected toByears ago. - Trailing-slash loops: If your host forces trailing slashes on static directories while your
_redirectsrule points to a slashless target (or vice versa), a browser can bounce between301responses until it aborts. Match the canonical trailing-slash convention everywhere. - Broken fragment anchors (
#section): When redirecting/legacy-directory/to a section anchor on another page, confirm the target HTML actually containsid="section"before activating the redirect — HTTP servers never inspect fragments, so a typo silently drops readers at the top of the destination page. - Forgotten external dependencies: Never activate a cross-site redirect until the destination site has already published the target page or anchor.
Test every old address and destination
Start your local hosting runtime (for example Wrangler’s local dev server for Cloudflare Static Assets) and inspect the raw HTTP headers without following redirects automatically (--location omitted):
curl --silent --show-error --output /dev/null --dump-header - \
http://127.0.0.1:8787/old-guide/
To verify a whole batch of retired and redirected paths in one pass, check status codes in a quick shell loop:
for path in /old-guide/ /old-guide /blog/ /services/legacy-offer/; do
code=$(curl -s -o /dev/null -w "%{http_code} -> %{redirect_url}" "http://127.0.0.1:8787${path}")
echo "$path : $code"
done
For INHUVESA, we tested every legacy editorial address with and without its trailing slash in Cloudflare’s local runtime, confirming HTTP 301 and the expected Location header, and verified in the Astro preview that all 33 retired corporate addresses — including aliases — returned 404. Remember these are local rehearsal checks: after publishing, repeat the exact same curl checks against the public domain, where edge cache rules and SSL settings determine what readers actually receive, and check indexing reports in Search Console and Bing Webmaster Tools over the following weeks.