Skip to content
migration.tools
URL list to Redirect rules

Bulk 301 redirect generator

A site migration lives or dies on its redirect map. Paste the old and new URLs — two columns from a spreadsheet work as they are — and get rules for your server, with duplicates removed, self-redirects caught and chains flattened so every old URL reaches its destination in one hop.

Options
A third column on any line overrides this.

Old URL, new URL

Redirect rules

The result appears here as soon as there is input.

Processed on this device. Nothing you paste or drop is uploaded.

How to use it

  1. 1Paste two columns: the old URL, then the new one. Add 302 or 410 as a third column for exceptions.
  2. 2Choose the server or platform the new site runs on.
  3. 3Check the notes for duplicates, loops and chains, then copy the rules or download the file.

Why chains and duplicates matter

Each extra hop in a redirect chain costs a round trip and loses a little of the link equity that 301s are meant to preserve; search engines also stop following after a handful of hops. Chains creep in when this year's migration is layered on top of last year's. With flattening on, every source points straight at the final URL.

A source listed twice is ambiguous — servers use whichever rule they reach first — so only the first is kept and the rest are reported. A rule that points at itself would loop forever and is removed.

Choosing an output format

Apache rules use mod_rewrite, anchored at both ends so /about doesn't also catch /about-us, and handle old URLs that carry a query string (products.php?id=42) with a RewriteCond, which a plain Redirect directive can't match.

For nginx, the map format scales to tens of thousands of URLs with a single hash lookup per request; location blocks are easier to read for a short list. Netlify, Vercel, Next.js and Caddy outputs are ready to commit. Cloudflare's format is the CSV its Bulk Redirects uploader takes.

Questions

Should I use 301 or 302 for a migration?

301 (or 308) for anything permanent — it tells search engines to transfer the old URL's signals to the new one. Use 302 or 307 only when the old URL will come back, such as a seasonal page.

How do I build the list of old URLs?

Combine the old site's XML sitemap (the sitemap extractor turns it into a list), a crawl, and the top landing pages from analytics and Search Console. Then use the URL mapping tool to pair old URLs with new ones automatically.

Is there a limit on the number of redirects?

No fixed limit — tens of thousands of lines convert instantly. Check your platform's own limits: Vercel and Netlify cap the number of redirect rules per project.

Guides that use this tool