301 Redirect Generator

Turn a list of old and new URLs into redirect rules.

  • SEO Tools
  • Free, no sign-up
  • Runs in your browser

301 Redirect Generator tool

Separate the two with a comma, tab, pipe or spaces.

—

About the 301 Redirect Generator

Changing a site's structure, moving to a new domain or renaming pages without redirects sends visitors to error pages and throws away the search rankings the old pages earned. This 301 redirect generator turns a two-column list of old and new URLs into rules in the syntax your platform needs: Apache, Nginx, Netlify, Vercel or Cloudflare bulk redirects. Permanent 301 redirects pass visitors and ranking signals to the new address. Redirect each old page to its closest new equivalent rather than sending everything to the home page, and avoid chains of several redirects in a row. To learn what each response code means, see the HTTP Status Code Reference, and for other Apache rules, the .htaccess Generator.

The tool examines your list for outage-causing errors before it produces a single rule. If two addresses forward to each other, visitors circle endlessly and neither page can be reached. Hopping from A to B and then on to C still reaches the goal but costs time and a little ranking strength, so the tool offers to flatten it so every old address points directly at its final destination. Duplicate entries, where the same old address has two different targets, are ambiguous and are flagged as well.

Each rule can be permanent or temporary. For a site move you nearly always want 301, which tells search engines the change is lasting and that the new address should take over the old one's place; 302 is meant for short-lived moves where the original will return.

How to use the 301 Redirect Generator

  1. Paste your redirect listGive each pair its own row, old address first, then the new one.
  2. Choose your platformApache, nginx, Netlify, Vercel or Cloudflare.
  3. Read the warningsLoops, chains and repeated old addresses are listed before anything is generated.
  4. Copy the rulesAdd them to your server settings and test them before the site goes live.

301 Redirect Generator features

  • Output for Apache, nginx, Netlify, Vercel and Cloudflare
  • Choice of lasting or short-term redirect codes
  • Detection of redirect loops
  • Multi-hop paths spotted and collapsed on request
  • Warnings for the same old address listed twice
  • Works with complete links or site-relative paths
  • Copy or download the rules

Common uses

  • Moving a website to a new URL structure
  • Pointing discontinued product pages at their successors
  • Consolidating overlapping articles into a single stronger page
  • Switching from one domain name to another
  • Porting rules when changing hosting platforms

Redirects in practice: changing a blog's permalink structure, moving domains, mapping old pages, testing and caches

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Redirects keep visitors and search rankings when addresses change. A good redirect plan sends every old address to its closest new equivalent in a single step; a poor one loses traffic for months. This guide redirects a blog whose permalink structure changed, then covers moving to a new domain, mapping pages properly, consolidating https and www, testing redirects and clearing caches.

A worked example: a new permalink structure

A WordPress blog switches from addresses such as /2019/05/best-time-to-visit-swat/ to /best-time-to-visit-swat/. Rather than writing hundreds of individual rules, one pattern handles every post. On Apache, RedirectMatch 301 ^/\d{4}/\d{2}/(.*)$ /$1 captures the slug and redirects to the new address. On nginx, rewrite ^/\d{4}/\d{2}/(.*)$ /$1 permanent; does the same. Testing a few old posts confirms each lands on its new address in one step.

Moving to a new domain

When a site moves to a new domain, redirect every old address to its equivalent on the new domain, page by page. After the redirects are live, Search Console's Change of Address tool tells Google about the move. Keep the redirects in place for at least a year, and ideally permanently, since old links around the web keep sending visitors.

Map pages to their closest match

Each old page should redirect to the most relevant new page. Redirecting everything to the home page frustrates visitors and is treated by search engines much like a missing page. Where no equivalent exists, a helpful 404 page with search and popular links can serve visitors better than an irrelevant redirect.

One hop, no chains

Combining https, www and path changes into a single redirect avoids chains such as http to https, then to www, then to the new path. Each extra step slows visitors and weakens the redirect. Order server rules so that a request reaches its final address in one hop.

Testing redirects

The command curl -I followed by an old address shows the status code and the Location header it redirects to. Test a sample of old addresses from analytics and from external links, including addresses with parameters and trailing slashes, which are easy to miss in patterns.

Caches and Varnish

Sites behind Varnish or a CDN may keep serving cached old responses after redirect rules change. Purge the cache once the new rules are live. Browsers also cache permanent redirects firmly, so test in a private window, and be careful with mistakes, which visitors' browsers may remember.

Keeping a redirect map

Record every redirect, with old and new addresses and the date, in a spreadsheet or in version-controlled configuration. When pages change again in future, the map shows where existing redirects lead and prevents creating loops or chains.

Monitoring after the change

For several weeks after a large redirect project, watch Search Console for spikes in not found errors and check the traffic of important pages. Old addresses that still produce errors reveal pages missing from the redirect map, which can then be added.

Common mistakes

  • Redirecting all old pages to the home page.
  • Creating chains through several redirects.
  • Removing redirects after a few months.
  • Forgetting to purge caches after changing rules.

Related tools

For Apache rules more broadly, use .htaccess Generator. To understand the response codes, try HTTP Status Codes, and to declare preferred addresses, Canonical Tag Generator.

Deleted products

When a product is discontinued, redirect its page to the closest alternative or its category if visitors would find that useful. If nothing comparable exists, a 410 Gone status tells search engines the removal is deliberate. Either is better than a page that shows an error with a normal status code.

Keep query strings

Visitors arriving through tagged campaign links should keep their tags after a redirect, otherwise analytics loses the source. Some rule styles drop query strings unless told otherwise. Test old addresses with parameters attached to confirm the parameters arrive at the new address.

Avoid page-level redirects

Redirects written in HTML with meta refresh, or in JavaScript, are slower and less reliable than server redirects, and search engines may treat them less confidently. Use server-side redirects with proper status codes whenever you control the server.

Update internal links

Redirects catch old links from elsewhere, but your own site's links should point directly at the new addresses. Updating menus, internal links and sitemaps removes unnecessary redirect steps for visitors and gives search engines a clear picture of the current structure.

Case and trailing slashes

Old links may vary in letter case and trailing slashes. Rules that normalise these variations, sending /About/ and /about to one preferred address, catch links that individual rules would miss. Test a few variations after deploying the rules.

Document temporary redirects

Temporary redirects, such as a seasonal page sending visitors to a current offer, are easy to forget. Record them with an end date, and review them when the season ends, so a temporary redirect does not quietly become permanent and hide a page that should be live.

Privacy

Rules are generated in your browser. Nothing is sent anywhere or stored.

Frequently asked questions

When is a 301 better than a 302?

Use it for anything lasting, which covers nearly every site migration. A 301 tells search engines the new address replaces the old one. Keep 302 for situations where the original page really will come back, such as a short promotion.

Why are multi-step redirects a problem?

A chain is a series of hops, A to B to C. It still works, but each hop adds delay and browsers give up after several. Sending each retired address directly to where it finally belongs removes those detours.

What happens if my map contains a loop?

Browsers ping-pong between the addresses, then stop with an error message, leaving the content inaccessible. The tool finds loops before you deploy anything, which is far better than discovering them on a live site.

Do redirects keep all of the old page's ranking value?

When the new page closely matches the old one, almost all of it carries over. Funnelling every retired page to the homepage, by contrast, is commonly treated as if the old page had simply vanished.

How long should I keep redirects in place?

Keep them for a minimum of twelve months, and indefinitely while old links still bring visitors. Removing them too early breaks every bookmark, email and external link that still uses the old address.

Does the tool test the redirects for me?

No, it only writes the rules. Trial them on a non-public copy first; one faulty rule can take every page offline. Afterwards, request a few old addresses and confirm each lands on its new page with a 301 status.