Browser-based SEO tool · your URL list stays in this tab

Bulk Redirect Generator

Paste an old-to-new URL list or open a CSV, and get working redirect rules for Apache, Nginx, Netlify, Vercel, Cloudflare, IIS and Next.js. Loops, chains, duplicates and self-redirects are found first, so the rules you copy do not create new problems.

Old and new URLs

One pair per line: comma, tab, space or -> between them. An optional third value sets the status (301, 302, 303, 307, 308).

Options

Lines read
9
Rules written
6
Dropped
3
loops, duplicates, self
Errors / warnings
2 / 1

Checks

Errors remove a rule from the output; warnings tell you what was changed.

  • info1 destinations are absolute URLs and 5 are relative paths. Both work; mixing is only a style question.
  • info1 destinations are absolute URLs on the same host as the old URLs; relative paths would survive a domain change.
  • warningline 5:Chain: /old-shop → /shop → … → /store (2 hops). Flattened to point straight at /store.
  • errorline 8:The old and new URL are the same, which would redirect forever; the line is dropped.
  • errorline 9:Redirect loop: /a → /b → /a. These rules are dropped.

Output

Browsers drop the leading dot from downloaded file names, so rename the file to .htaccess after saving.
RewriteRule never sees the query string, so rules for old URLs with a ?query use a RewriteCond on %{QUERY_STRING} and drop it after redirecting.

Final rules (6)

After flattening and removals

LineOldNewStatus
2/about-us.html/about301
3/blog/2019/spring-sale/blog/spring-sale301
4/products/widget?id=42/shop/widget-42301
5/old-shop/store(was /shop)302
6/shop/store301
7/careers.phphttps://example.com/jobs308

Bulk Redirect Generator

Operator: Abdulla Al Fahad. How tools are built and checked

A site migration usually produces a spreadsheet: a column of old URLs, a column of new ones, and a deadline. Turning that sheet into server rules is where mistakes creep in. Two rows contradict each other, a page that moved twice leaves a chain of redirects, two pages point at each other and the browser gives up with a loop error. Each platform also wants its own syntax, and a regular expression written for Apache is not the line you put in Nginx.

This generator takes the list once, checks it, and writes the rules for seven targets: Apache .htaccess, an Nginx map, a Netlify _redirects file, vercel.json, a Cloudflare bulk redirect CSV, IIS web.config and a Next.js redirects array. Loops, duplicates and self-redirects are removed with a line-numbered explanation, chains are flattened to point at the final page, and you choose how query strings and trailing slashes are treated.

Key features

  • Accepts commas, tabs, spaces, -> or => between the two URLs, an optional third column for the status, and skips a header row and comment lines
  • Detects redirect loops, chains, duplicates, self-redirects, empty and malformed lines, and reports each with its line number
  • Flattens chains so A to B to C becomes A to C, or leaves them and only warns
  • Statuses 301, 302, 303, 307 and 308, with a default for lines that have none
  • Options for keeping or dropping the visitor's query string, matching with or without a trailing slash, and case-insensitive matching
  • Copy or download each output, with notes where a platform cannot do what you asked

How each platform's rules are written and what is checked first

Each line is read as an old URL and a new URL. Old URLs may be bare paths or full URLs; the host of a full URL is remembered as one of your site's hosts and the rules match on the path. A fragment after # is dropped from the old URL because servers never receive it, and a ?query on the old URL is turned into a condition so only that exact query matches. New URLs may be paths or absolute URLs; a path without a leading slash is given one, and a value that looks like a domain without https:// is flagged, because it would otherwise be read as a path on your own site.

Duplicates are decided by the old URL, with or without its query: the first line wins, an identical repeat is reported as a warning, and a repeat that points somewhere else is reported as an error and dropped. A line whose old and new URL are the same is dropped as a self-redirect. Loops are found by following each rule's destination through the other rules; every rule in a cycle is dropped and the cycle is written out, for example /a → /b → /a. A chain is a destination that is itself an old URL; with flattening on, the first rule is rewritten to point at the last destination and keeps its own status.

Apache output uses mod_rewrite, because the plain Redirect directive matches a prefix and would also redirect everything under the old path. Each rule is a RewriteRule with an escaped, anchored pattern, R=status and L; a trailing slash is made optional with /?, and rules with an old ?query get a RewriteCond on QUERY_STRING. Dropping the query adds a trailing ? to the target; keeping it with a target that has its own query adds QSA.

Nginx output is a map from $uri, the decoded path without query, to a value of the form 301 /new-path, with one exact entry per path and one for the version with a trailing slash. A small if block in the server context splits the value and returns it, adding $is_args$args when the query is kept. Rules for old URLs with a query use a second map on $request_uri. Case-insensitive matching switches the entries to regular expressions, which nginx evaluates in order. Netlify, Vercel and Next.js outputs carry the status explicitly; Cloudflare gets host/path sources and full-URL targets in the bulk redirect column order; IIS gets one rewrite map per status plus a rule for each, and 308 is written as a 307 because URL Rewrite has no 308 option.

How it works

Parsing, checking and writing are separate steps over the same list of rules. The check step produces the issue list and the final rules; each writer then turns the final rules into text, adding notes when an option cannot be honoured on that platform, such as dropping query strings on Netlify, Vercel or Next.js, which always forward them. Changing an option re-runs the checks and rewrites every format, so the numbers and outputs stay in step.

Typical uses

  • Converting a migration spreadsheet of 400 rows into one Nginx map and one Netlify _redirects file before launch
  • Finding the accidental loop between two category pages that were each redirected to the other during a restructure
  • Replacing a long chain left by three rounds of URL changes with one hop per old address
  • Producing a Cloudflare bulk redirect CSV from the same list used for the server rules

Building one

  1. Paste the old and new URLs, or choose Open CSV. The sample button shows the layout.
  2. Set the default status, whether to flatten chains, and the query and slash options. Fill in Site host and Destination origin if you want a Cloudflare file.
  3. Read the Checks panel. Each error says which line was dropped and why.
  4. Pick an output tab and read the notes above the text.
  5. Copy it or download the file, then merge it into your server or hosting configuration and test a few URLs.

Example

Five lines from a migration sheet

/about-us.html,/about
/old-shop,/shop,302
/shop,/store
/a,/b
/b,/a

Checks, then Netlify _redirects and an Apache rule

Line 2  warning  Chain /old-shop -> /shop -> /store (2 hops), flattened
Line 4  error    Redirect loop /a -> /b -> /a, rules dropped

_redirects
/about-us.html /about 301
/old-shop /store 302
/shop /store 301

.htaccess
RewriteRule ^about-us\.html/?$ /about [R=301,L]

Tips for best results

  • Fix the errors in the spreadsheet, not just in the output, so the next export does not reintroduce them.
  • Redirect to the final page directly. Each hop adds a round trip for visitors and spreads link signals across more URLs for crawlers.
  • Use 301 or 308 for moves that are permanent and 302 or 307 for temporary ones. 307 and 308 keep the request method, which matters for POST.
  • Test a handful of rules with curl -I after deploying: the status line and the Location header should match the list.
  • Keep the trailing-slash option on unless your site treats /page and /page/ as different pages on purpose.

Things to check before you rely on it

A rule written for the wrong context does nothing. The Apache output is for .htaccess; in httpd.conf, patterns need a leading slash, as the comment in the file says.

Large lists have platform limits. vercel.json historically capped redirects at 2,048 entries, and a big redirects() array in next.config.js slows builds; the page adds a note when your list is large.

Regular-expression escaping covers literal characters in paths. A path that contains * or : is treated literally in Apache and Nginx, but Netlify, Vercel and Next.js read them as wildcards or parameters, so check those rows.

Redirecting to a different host cannot be checked for loops. A rule pointing at another domain is trusted to end there.

Common errors and how to fix them

"Only one value on this line"
Add the new URL after a comma, a tab or ->. A path with a space in it should be quoted in a CSV, or written with %20.
"The old and new URL are the same"
Remove the row, or correct the new URL. Trailing slashes and uppercase are normalised before this check, so /Page/ to /page counts as the same only if case-insensitive matching is on.
"Redirect loop"
Decide which page is the real destination and delete the rule that points back at it.
"has no https:// in front"
If the target is another site, write the full URL with its scheme. If it is a page on your site, ignore the warning or write it as a path.

Best practices

  • Keep the source spreadsheet under version control next to the generated files so a change to one is visible in the other.
  • Redirect old URLs to the closest equivalent page, not to the home page, so visitors and crawlers land where they expected.
  • Leave redirects in place for at least a year after a move, and longer for pages with many inbound links.

Query strings and what each platform does by default

Servers disagree about whether a redirect carries the original query string. Apache's RewriteRule keeps it unless the target has its own, Nginx's return drops it unless you add $is_args$args, and Netlify, Vercel and Next.js forward it. The Keep query string option makes the first two behave like the others, and the notes under each output say when a platform cannot drop it.

A rule for an old URL that itself contains a query, such as /products?id=42, is matched only for that exact query and consumes it; the visitor's query is not appended in that case.

Frequently asked questions

Is a 301 or a 302 better for SEO?

Use 301 (or 308) when the move is permanent so search engines transfer the old URL to the new one, and 302 (or 307) only when you intend to bring the old URL back.

Why does Apache use RewriteRule instead of Redirect?

Redirect matches by prefix, so /shop would also catch /shop/anything. RewriteRule with anchors matches exactly the path you listed.

Does the tool test my redirects?

It checks the list for loops, chains and duplicates. It cannot request your live site, so test the deployed rules yourself.

How many rows can I paste?

The page has no fixed row limit, but the platforms do, and a very large list slows the checks in the browser. Split lists of many tens of thousands of rows.