301 Redirect Generator

Paste your old and new URLs and get the rules for Netlify, Apache, Nginx, Cloudflare or WordPress — with chains, loops and duplicates found before you ship them.

One pair per line, separated by a comma, a tab or a space. Paths or full URLs, and a CSV pasted straight out of a spreadsheet works. An optional third column sets the status code for that row.
Used to tell your own URLs from external ones, and to build the absolute URLs Cloudflare needs.
Use 301 unless the old URL is genuinely coming back. 308 and 307 keep a POST as a POST, which matters for forms and APIs and nowhere else.
Options
Redirect rules

          

Nothing you type here is uploaded, stored or sent anywhere. It all runs in your browser.

Chains are the thing that quietly costs you

A chain is /a/b/c. Every browser follows it, so nothing looks broken, and that is exactly why it survives three migrations. Google follows up to about ten hops before giving up, so the page still gets found. What you lose is time and certainty: every hop is another request, another chance for a rule to be dropped, and another layer between the link someone built to /a six years ago and the page that link is meant to be pointing at.

The fix is not to delete the old rules. It is to rewrite each one to point at the final destination, keeping every source URL alive. Tick "flatten chains" above and this tool does that for you. /a/c and /b/c, both still there.

The four errors worth finding before deploy

  • A loop. /a/b and /b/a. The browser gives up after about twenty hops and shows an error page. This is a hard outage on those URLs and it usually happens when two people edit the same list.
  • A duplicate source. The same old URL listed twice with different destinations. Every server takes the first match and silently ignores the second, so half your rules do nothing and you have no idea which half.
  • A URL redirecting to itself. An instant loop, and the most common cause is a trailing slash the server normalises away before the rule is even evaluated.
  • A trailing-slash-only change. /services//services looks harmless. If your server or CDN also normalises slashes in the other direction, the two fight each other and you get a loop that only appears in production.

Where redirects actually leak value

Google has been clear for years that a 301 passes essentially all ranking signals, so the old "15% loss per hop" folklore is not a thing to plan around. The real leaks are duller. Redirecting everything to the homepage instead of the closest matching page — Google treats a mass redirect to an unrelated page as a soft 404 and the signals go nowhere. Forgetting to redirect the URL variants: http, www, trailing slash, uppercase. Leaving redirects in place for a year and then removing them because the list "looks old", after the CMS has stopped serving the old URLs anyway.

Redirects are permanent infrastructure. Keep them for at least a year, and if the URL had links pointing at it, keep them forever.

What each format actually matches

These are not equivalent and the differences bite. Apache's Redirect is a prefix match, so Redirect 301 /blog /news also moves /blog-archive. Nginx's location = is exact but ignores the query string entirely. Netlify matches the path and passes the query string through by default. Cloudflare Bulk Redirects need absolute URLs on both sides. This tool warns when a rule you have written is going to behave differently from how it reads.

Questions people ask

Should I use 301 or 302?

301 for anything that is not coming back, which is nearly everything. 302 tells Google to keep the old URL indexed and not transfer signals, which is right for an A/B test, a temporary sale page or a geo-redirect you intend to remove. In practice Google treats a 302 that has been in place for months as a 301 anyway, so the main cost of getting it wrong is the months in between.

What is 308 for?

A 301 is allowed to change a POST into a GET, and most clients do. A 308 is a permanent redirect that keeps the method and the body intact. For pages it makes no difference and 301 is better supported. For a form endpoint or an API that moved, 308 is the correct answer and 301 will silently drop the request body.

How long should I keep redirects in place?

A year is the usual floor, because that is roughly how long it takes for Google to fully consolidate and for people to update bookmarks. If the old URL had external links pointing at it, keep the redirect permanently — those links are the entire reason you bothered. Removing a redirect that carries live links is throwing away something you paid for.

Can I redirect the whole old site to the new homepage?

You can, and it will not do what you want. Google treats a redirect to an irrelevant page as a soft 404 — the old URL gets dropped and the signals go nowhere. Map each URL to its nearest equivalent. Where there is genuinely no equivalent, a 410 is more honest and gets it out of the index faster.

Does this tool check that my redirects work?

No. It checks the list against itself — the chains, the loops, the duplicates, the syntax for your server. It cannot request any URL, because a browser cannot fetch another site and read the response. Once the rules are deployed, test them with curl or a crawler.

Is my URL list sent anywhere?

No. Everything happens in your browser. That matters here, because a redirect map is a complete inventory of a site including whatever you are about to launch.

A migration keeps the links you already have

Redirects protect what a site has earned. Growing past it means earning more, which is the part nobody can automate.

Book a Call More free tools