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.

Decision tree for repairing a broken link
Update, remove, or redirect according to what happened to the content.

Repair sequence

  1. Export source URL, element/anchor, raw target, final URL/status, and redirect chain.
  2. Retest with normal GET in a browser/curl; account for cookies, user-agent, WAF, rate limiting, and temporary 5xx.
  3. If content moved, update internal href directly to the final 200 URL and retain a relevant 301 from the old address.
  4. If no equivalent exists, remove the link or rewrite the sentence; let the removed target return an honest 404/410.
  5. If the target should exist, restore its route/content/permissions instead of redirecting elsewhere.
  6. Repair shared templates/components before instances, purge cache, and repeat the crawl.
  7. 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.