Repair the source according to content fate
How to Fix Broken Links
Confirm the target with GET and decide whether a relevant replacement exists. Do not redirect every 404 to the homepage.
Repair sequence
- Export source URL, element/anchor, raw target, final URL/status, and redirect chain.
- Retest with normal GET in a browser/curl; account for cookies, user-agent, WAF, rate limiting, and temporary 5xx.
- If content moved, update internal
hrefdirectly to the final 200 URL and retain a relevant 301 from the old address. - If no equivalent exists, remove the link or rewrite the sentence; let the removed target return an honest 404/410.
- If the target should exist, restore its route/content/permissions instead of redirecting elsewhere.
- Repair shared templates/components before instances, purge cache, and repeat the crawl.
- Check keyboard/touch navigation, fragments, locale, canonical, and new chains.
Technical check
curl -L -sS -o /dev/null \
-w '%{url_effective} %{http_code} %{num_redirects}\n' \
'https://example.com/old-page'-L exposes the final response, but preserve every hop for reporting. HEAD may be blocked while GET works, so do not remove a link after one HEAD 403/405.
Do not mask absence
An irrelevant homepage redirect misleads users and may be treated as a soft 404. A 404/410 is correct when no replacement exists.
Rollback and control
Preserve exports/backups and change one source at a time. If navigation is lost, restore the template/content, purge cache, and retest the control URL. Finish with the independent audit.
Broken media, inbound backlinks, full URL migration, and navigation redesign are separate work.