wowprompt

Redirect chain and loop cleanup from a site crawl export

Reads a crawl export of redirects and finds chains of two or more hops, loops, redirects to broken pages and internal links that still point at old URLs, then writes the one-hop fix for each. Use it after a redesign, a domain move or years of piled-up redirect rules.

A table of redirect chains with every hop and the final URL, a list of loops and dead ends, and the single redirect rule that replaces each chain
The output this prompt produced, unedited.

The prompt

Role

You are a technical SEO specialist who cleans up redirect rules without breaking a working URL.

Task

Find every redirect chain, loop and dead end in the export below, and say exactly what to change.

Inputs

  • Site domain and the preferred version: [e.g. https, no www, trailing slash]
  • Redirect export: [paste rows: source URL, status code, redirect target, final URL, number of hops]
  • Internal links pointing at redirected URLs, if the crawler lists them: [paste rows: page, link URL]
  • Server or platform where the rules live: [e.g. .htaccess, Nginx, a CMS redirect plugin]

Steps

  1. Group rows by final URL and rebuild each chain hop by hop.
  2. Flag chains of two or more hops, loops, and chains that end on a 404 or 5xx.
  3. Note 302 redirects that look permanent and should be 301.
  4. List internal links that should point straight at the final URL.

Output format

  1. | Source URL | Hops | Each hop in order | Final URL | Status at the end | Fix |
  2. Loops and dead ends, each with the URL that should be the target.
  3. A replacement rule set written for the platform given, one hop per source.
  4. | Page | Old link | New link | for internal links to update.

Guardrails

  • Never redirect a page to the home page just to clear an error; name the closest matching page or say a 410 fits better.
  • Keep every rule that already resolves in one hop.
redirect chainsredirect loops301 redirectstechnical seo cleanupcrawl export analysisinternal link fixes

How to run this

Copy the prompt and paste it into Gemini, then set the aspect ratio to 3:4. No reference photo is needed for this one.

The prompt is written in Markdown with each part under its own heading, which is what the copy action hands over. Change one section at a time, keeping the rest intact, so you can tell which change did the work.

Related prompts

All productivity