← Back to Blog

Broken Link Fix Generator — Turn an Audit Into a Deployable Redirect Bundle

Broken Link Fix Generator — Turn an Audit Into a Deployable Redirect Bundle

The Internal Link Auditor finds broken and redirect-chained URLs. That's half the job. The other half is shipping a fix that covers all four places a URL reference lives:

  1. The web server's redirect config
  2. The source HTML that contains <a href> / canonical / JSON-LD references
  3. The sitemap.xml that still lists the dead URL
  4. The external indexers (Google, Bing, Yandex) still serving the old URL in results

If you only fix #1, your own users and crawlers hit an extra hop on every internal click. If you only fix #2, external backlinks still break. If you only fix #3, the sitemap-to-live-site delta looks good but the old URLs still rank. If you only fix #4, you chase indexers without giving them a redirect to follow.

The Broken Link Fix Generator emits everything needed for all four fixes from one URL-map input.

What it emits

From a single old | new URL map, the tool produces:

  • Netlify _redirects and Cloudflare Pages _redirects, both use the same syntax Netlify pioneered; the ! flag overrides any lingering static file.
  • Cloudflare Workers, an edge-compute JS handler, faster than static _redirects for already-cached traffic. Deploy with wrangler deploy.
  • Vercel vercel.json, JSON redirect array that merges cleanly into existing config.
  • AWS CloudFront Functions, a viewer-request handler (cheaper than Lambda@Edge for simple redirects). Attach to your CloudFront distribution.
  • DigitalOcean App Platformapp.yaml ingress rules for the static-site component. Apply via doctl apps update.
  • Apache .htaccessRewriteRule blocks with per-status-code flags (R=301, R=302, R=308, or [G,L] for 410-gone).
  • nginx location blocks, one per URL, drop inside your server { } block.
  • Caddy redir directive, native Caddy syntax with permanent / temporary status codes, works with automatic HTTPS. See the Caddy server writeup for the full stack context.
  • sed patch, shell script that walks src/**/*.html, *.md, *.njk and rewrites every occurrence of the old URL to the new one.
  • IndexNow JSON body, ready to POST to https://api.indexnow.org/indexnow so Bing, Yandex, and other IndexNow participants recrawl within minutes.

The same URL map drives every output. Ship whichever matches your stack plus the sed patch plus the IndexNow POST, all three at once.

Why the sed patch matters

A redirect is a band-aid. Every internal click to an old URL burns a server request, adds 100-300ms latency, and counts toward Google's "excessive redirect" threshold when aggregated across a site with hundreds of moved URLs.

The sed patch eliminates the hop for your own traffic by rewriting every in-HTML reference. After you run it, only external backlinks still trigger the redirect. Internal traffic goes straight to the new URL.

Three places the sed patch catches that manual fixes often miss:

  • <link rel="canonical" href="...">, a stale canonical tells Google "the old URL is the real one," undoing the redirect's signal
  • JSON-LD url and @id fields, structured data still claiming the old URL as the page's identity
  • <sitemap><loc> entries in custom sitemap generators that read from a source file instead of a database

The four status codes

The tool lets you pick the redirect's status code because the choice matters:

  • 301 (moved permanently), the normal case. Tells search engines "transfer all signals to the new URL." Browsers cache aggressively; if you ever want to un-redirect the URL, you'll need to blow out the browser cache manually.
  • 302 (found / temporary), for A/B tests and truly temporary moves. Does NOT transfer ranking signals.
  • 308 (permanent, preserve method), like 301 but preserves the HTTP method (POST stays POST). Use for API endpoints; overkill for most HTML pages.
  • 410 (gone), the URL is deliberately dead. Better than 404 when you know the page won't come back, because GSC de-indexes 410'd URLs within 24-48 hours vs several weeks for 404s. The generator emits - 410 for Netlify and [G,L] for Apache.

If in doubt, ship 301 unless you're killing a URL permanently with no replacement, then ship 410.

The IndexNow win

Bing's IndexNow protocol is underused. Most sites do not implement it because most sites do not think about Bing. Bing has 8-15% market share in the US (higher in some verticals) and is the data source Google uses to train some features. Leaving Bing un-indexed leaves real traffic on the table.

IndexNow is a trivial POST. The generator builds the full payload: every old URL (to signal "please recrawl") plus every new URL (to signal "please discover"). Paste the payload, POST it, and Bing starts recrawling within minutes instead of waiting for its next sitemap poll.

Google does not currently participate in IndexNow. For GSC you still regenerate the sitemap and resubmit via Search Console.

The deployment order

The tool emits a 5-step "Ship order" checklist with the outputs. Summarized:

  1. Commit the redirect config (Netlify / Apache / nginx / Vercel) and deploy. This makes the redirect live.
  2. Run the sed patch against src/. Eliminates internal redirect hops. git diff to verify before committing.
  3. Regenerate sitemap.xml. Remove 410'd URLs; replace 301 sources with their targets. Run Index Coverage Delta to confirm the sitemap is aligned.
  4. Submit sitemap to GSC + Bing. POST IndexNow payload to api.indexnow.org.
  5. Re-audit in 7 days. Any remaining 301 = sed missed a reference OR the link is JS-constructed. Patch and redeploy.

Skipping any step leaves a visible symptom. Skip step 2 and your own users hit redirect chains. Skip step 3 and GSC flags "Submitted URL not found (404)." Skip step 4 and Bing keeps serving the dead URL in results for weeks. Skip step 5 and you think you're done when you're not.

The paired audit

This generator is designed to consume the CSV output of the Internal Link Auditor. Run the audit, export the broken + redirected URLs, paste into the generator, ship the fix bundle. The full round-trip takes about 10 minutes on a site with 50-100 broken links.

If you're not sure which old URL maps to which new URL (moved content without a clear successor), the tool accepts a single URL per line and treats it as a 410. Kill the URL cleanly rather than redirecting it to a vaguely-related page, soft 404s hurt more than honest 410s.

Related reading

If you run an agency or client portfolio where URL sprawl is a constant background cost, the $20 Dollar Agency walks through the migration SOP: The $20 Dollar Agency.

Fact-check notes and sources

← Back to Blog

Accessibility Options

Text Size
High Contrast
Reduce Motion
Reading Guide
Link Highlighting
Accessibility Statement

J.A. Watte is committed to ensuring digital accessibility for people with disabilities. This site conforms to WCAG 2.1 and 2.2 Level AA guidelines.

Measures Taken

  • Semantic HTML with proper heading hierarchy
  • ARIA labels and roles for interactive components
  • Color contrast ratios meeting WCAG AA (4.5:1)
  • Full keyboard navigation support
  • Skip navigation link
  • Visible focus indicators (3:1 contrast)
  • 44px minimum touch/click targets
  • Dark/light theme with system preference detection
  • Responsive design for all devices
  • Reduced motion support (CSS + toggle)
  • Text size customization (14px–20px)
  • Print stylesheet

Feedback

Contact: jwatte.com/contact

Full Accessibility StatementPrivacy Policy

Last updated: April 2026