301 Redirect Mapper Skill

Feed in the old crawl and the new sitemap, approve what it matched, and get redirect files for your server or platform, with chains collapsed and loops caught before launch.

301 Redirect Mapper Skill cover

What it does

Map every old URL to its new URL for a site migration, catch chains and loops, and export ready-to-paste 301 rules for Apache, Nginx, Netlify, Vercel, Cloudflare and Shopify. It works as a Claude Code plugin (skill redirect-mapping) or as a command-line tool. Python 3.9+, no dependencies. Everything runs offline except the optional live check.

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 14 tests OK on Python 3.13 and 3.10.

Real terminal output from 301 Redirect Mapper Skill: demo and passing tests

Quick start

python3 -m redirmap map old-crawl.csv new-sitemap.xml --out migration/ --host yourdomain.com --rule "/blog/ => /journal/"
# review migration/map.csv (approve low rows, fix targets), then:
python3 -m redirmap export migration/map.csv --format apache --out migration/exports --new new-sitemap.xml
python3 -m redirmap check migration/map.csv --base https://staging.yourdomain.com --out check.csv
./demo.sh        # WordPress-to-new-site example
./run_tests.sh   # 14 tests

Inputs

Old and new URL lists can be any of these:

  • sitemap.xml or .xml.gz
  • a crawl or Search Console, Ahrefs or Semrush CSV (the Address / URL / Top pages column is found automatically; Title 1 / Title is used too)
  • a plain list with one URL per line

How it matches (in order)

LevelMethod
exactsame path, no redirect needed
highsame path after normalizing case, trailing slash, .html/.php, index.php
highyour prefix rules (/shop/ => /products/)
highsame final slug (dates like /2023/05/ ignored), or the same slug words in another order or form
mediumsame slug in several sections (best path wins; alternatives listed)
mediumsimilar words in the slug, path or old page title (query-string URLs like ?page_id=42 match on title only)
lowa few shared words, or the closest parent section
noneno equivalent: let it 404 or 410, or choose by hand

High and medium rows are written with approve=yes. Edit map.csv and re-run export. Asset files (images, CSS, JS) are skipped unless you pass --include-assets.

Lint (runs on every export, or alone with lint)

  • Chains: collapsed so every redirect goes straight to the final URL. Google advises redirecting to the final destination and avoiding chains.
  • Loops and self-redirects: reported as errors and left out.
  • Duplicate sources with different targets: reported as errors.
  • Targets missing from the new URL list (with --new).
  • Many URLs pointing at the home page: Google says that may be treated as a soft 404.

Export formats

FormatFileNotes
apacheredirects.htaccessRedirectMatch 301 "^/old/?$", not Redirect, because Redirect matches prefixes (/blog would also catch /blog/post). Query-string sources use RewriteCond %{QUERY_STRING}.
nginxredirects.nginx.confa map $request_uri block plus a one-line return 301
netlify_redirects301! so the redirect works even if an old file still exists
vercelvercel.redirects.json"statusCode": 301. Vercel's permanent: true sends 308.
vercel-bulkvercel-bulk-redirects.csvfor bulkRedirectsPath (large lists)
cloudflarecloudflare-bulk-redirects.csvBulk Redirects list import (no header row)
shopifyshopify-redirects.csvRedirect from,Redirect to for Content > Menus > URL redirects > Import. Shopify only applies a redirect once the old URL returns 404
csvredirects.csvsource, target, status

Some rows are left out of certain formats, and the tool prints a note when that happens:

  • Query-string sources are left out of Netlify, Vercel and Cloudflare, which can't match exact query values.
  • Case-only or slash-only redirects (/About/ to /about) are left out of Netlify, Vercel and Cloudflare, where they can loop. Use the platform's trailing-slash setting there instead.
  • In Apache and Nginx those rows are written so they can't loop.

--code 308 is available for every format.

Honest limits

  • It matches on URLs and titles, not page content. Always review medium and low rows.
  • check sends one GET request per redirect to the site you name and doesn't follow redirects. Run it against staging or right after launch.
  • It doesn't deploy anything or edit your server.

Format and license

Zip, 22 KB, v1.0, 16 files. You may use and modify this kit for your own work and for clients you serve, including paid client work. Not affiliated with or endorsed by Apache, Nginx, Netlify, Vercel, Cloudflare or Shopify.

FAQ

Which platforms?
Apache, Nginx, Netlify, Vercel (json + bulk CSV), Cloudflare Bulk Redirects and Shopify, plus plain CSV.
Does it read page content?
No, it matches URLs and old page titles; review medium and low rows.
Can it test redirects?
Yes, check requests each old URL on your staging or live site and confirms a 301/308 to the right target.
How do I get the files?
Right after payment, Stripe’s confirmation page shows your download link.
Refunds?
Email hello@youraitools.co within 14 days if it doesn’t work and we can’t fix it.
Can I pay with crypto?
Yes. Pay the same price in USDC or USDT on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana from the "Pay with crypto" button, with no account or KYC. We check the payment on-chain and show your download links as soon as it confirms.

Get 301 Redirect Mapper Skill

Map old URLs to new ones for a site migration, collapse redirect chains, catch loops, and export 301 rules for Apache, Nginx, Netlify, Vercel, Cloudflare and Shopify.

Pairs well with

Download$29

Amazon Settlement Reconciliation Skill

Reconcile Amazon settlement reports (Flat File V2) to bank payouts offline: rows checked against total-amount, balanced journal, profit per SKU, gap and duplicate checks.

View Amazon Settlement Reconciliation Skill
Download$19

Contract Renewal Tracker Skill

Track contract and SaaS renewals from a spreadsheet: auto-renewals rolled forward, cancel-by deadlines, locked-in renewals flagged, .ics reminders. $19 once.

View Contract Renewal Tracker Skill
Download$19

Shopify Product CSV Checker Skill

Check a Shopify product CSV before import: headers, handles, variants, prices, weights and images, with safe auto-fixes and a change log. Works with old and new templates. $19 once.

View Shopify Product CSV Checker Skill

Related