Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website. More information (Cookie Policy)

Free Redirect Generator: 301 Rules for Any Server or Host

Turn a list of old and new URLs into 301, 302, 307, 308 or 410 rules for Apache, Nginx, IIS, Netlify, Vercel, PHP or WordPress, with loop and chain checks.

Tools

On this page

Learn everything to know on Redirect Generator!

Created on
25/11/26
Last update:
25/11/26
Redirect rules for an .htaccess file generated from a list of old and new page addresses

Summary

The redirect generator turns a list of old and new addresses into redirect rules for Apache, Nginx, IIS, Cloudflare or Netlify, Vercel, PHP or WordPress. Paste one pair per line, pick a default code (301, 302, 307, 308 or 410) and your server, then copy or download the file. It flags loops, chains, duplicates and conflicts.

Want to go further? Ask

What does the redirect generator do?

It writes the redirect rules for you, in the exact syntax of your server or host. You give it pairs such as /old-page /new-page, and it returns a block you can paste into .htaccess, an Nginx server block, web.config, a _redirects file, vercel.json, a PHP script or the functions.php file of a WordPress child theme.

Before writing anything, it checks the whole list. It follows each redirect to its final destination, so it can spot a loop (A goes to B, B goes back to A) and a chain (A goes to B, B goes to C). It also flags lines listed twice, addresses with two different targets and pages that point to themselves. Everything runs in your browser: no account, and your list is not sent anywhere.

How do you use it, step by step?

  1. Paste your pairs in the box, one per line: old address, new address, and an optional code. Separate the cells with a space, a tab, a comma or a semicolon. A CSV export from a spreadsheet works, and a header line is skipped.
  2. Start each address with / or https://. A line that does not is marked as an error.
  3. Pick the default code. It applies to every line without its own code. Use 301 for a page that moved for good.
  4. For a page you deleted, leave the new address empty and add 410 on that line, for example /discontinued-product,,410.
  5. Pick your server or host in the second list. The rules update as you type.
  6. Fix the errors and warnings shown above the table, then click Copy or Download.

How do you read the result?

Three counters come first: Rules ready, Errors and Warnings. Below them, a list explains each problem in plain words, and a table gives every line a status.

  • Ready: the line became a rule.
  • Left out: the line was dropped, because it repeats an earlier line, gives a second target for the same address or points to itself.
  • Error: the line was not understood, uses an unsupported code, or has no new address without being a 410.
  • Loop: visitors would never reach a page. Fix it before going live.
  • Chain: the rule works but takes several hops. Point the first address straight to the last one.

Chains matter because each hop slows the visitor down. Google's guide to site moves recommends "redirecting to the final destination directly" and, when that is not possible, keeping chains short (Google Search Central, site moves with URL changes).

Which code and which server format should you choose?

Pick the code from what happened to the page. Google lists 301 and 308 as permanent redirects, which show the new target in search results, and 302 and 307 as temporary ones, which keep the old page in results (Google Search Central, redirects and Google Search). The difference between the two pairs is that 307 and 308 keep the request method, which matters for forms and APIs, not for normal pages. For the full comparison, read 301 vs 302: when to use each.

Server or hostFile writtenWhere it goes410 rules
Apache.htaccessRoot folder of the siteYes (RedirectMatch gone)
Nginxredirections-nginx.confInside the server { } blockYes (return 410)
IISweb.configRewrite rules of the siteYes (custom response)
Cloudflare / Netlify_redirectsPublished folder of the siteWritten, check that your host accepts it
Vercelvercel.jsonRoot of the projectNo, those lines are left out
PHPredirections.phpTop of the entry script, before any outputYes
WordPressfunctions-redirections.phpfunctions.php of your child themeYes

For Apache, the tool writes RedirectMatch lines anchored with ^ and $, so each rule matches one exact path. The Apache manual explains that RedirectMatch matches a regular expression against the URL path, and that the gone status returns 410 with no target (Apache HTTP Server, mod_alias). For Vercel, the tool fills source, destination and statusCode in the redirects array, the fields Vercel documents for this file (Vercel docs, vercel.json redirects).

Examples

A blog that changed its URL structure

You move posts from /blog/2024/seo-tips to /blog/seo-tips. Paste one pair per post, keep 301 as default, pick your server. Each old post sends visitors and links to its own new address.

A shop that removed products

Products with a close replacement get a 301 to that replacement. Products with nothing similar get /old-product,,410. Google's site move guide says removed URLs should return 404 or 410 rather than pointing many old pages to one unrelated page such as the home page.

A chain left by an earlier migration

Your list contains /a /b and /b /c. The tool shows "Chain: /a → /b → /c" and marks the first line. Change it to /a /c and the warning goes away, while /b /c stays.

Common mistakes

  • Redirecting everything to the home page. Map each old page to its closest new page, or return 410.
  • Using 302 for a permanent move. Search engines then keep the old address in results.
  • Replacing your existing file. If .htaccess or _redirects already exists, add the new rules to it instead of overwriting it.
  • Forgetting the trailing slash. The tool treats /page and /page/ as the same address when it checks duplicates, but writes the exact path you typed. Use the form your old site really served.
  • Removing the rules too early. Google advises keeping redirects "generally at least 1 year" after a move.

What are the limits of the tool?

  • It does not test your server. It writes rules from your list. After publishing, test a few old addresses with the redirect checker.
  • It does not check that the new pages exist. A rule that points to a missing page sends visitors to an error. Run the broken link checker on the targets.
  • Paths only. A full address such as https://old-site.com/page is written as its path, so put the rules on the old domain. Query strings (the ?... part) are ignored.
  • One-to-one rules. There are no wildcard or pattern rules: every old address needs its own line.
  • No 410 on Vercel. Those lines are left out and the tool tells you how many.

New to the topic? The glossary entry on the 301 redirect explains how a moved page keeps its value, and the SEO migration checklist covers the steps around the redirect list.

When should you move to Sorank?

Use the generator for the rules, then watch what happens to your traffic. Redirects protect the visits you already have; they do not tell you whether the moved pages keep their rankings in Google or their place in AI answers. The Sorank GEO and SEO dashboard follows your Google traffic and your visits from AI assistants in one view, so you see quickly if a migration cost you visits, and Sorank keeps growing that traffic on autopilot.

Frequently asked questions

What is the difference between a 301 and a 302 redirect?

A 301 says the page moved for good, so Google shows the new address in search results. A 302 says the move is temporary, so Google keeps showing the old address. Use 301 (or 308) for migrations and 302 (or 307) for short-term changes.

How long should I keep 301 redirects in place?

Google advises keeping them for as long as possible, generally at least one year after a move. Visitors and old links may still use the old addresses long after that, so many sites keep them indefinitely.

Should I redirect deleted pages to the home page?

No. Google warns against sending many old pages to one unrelated page such as the home page. Redirect each deleted page to its closest replacement, or return a 410 when nothing similar exists.

Sources

Other Free SEO Tools

Testimonials from ambitious founders

0 to 10000 visitors in 5 months

Celio Fabianomonrobotlavevitre.frGoogleE-commerce

0 to 5000 visits in 8 months

Thibault BMsorank.comGoogleSoftware

0 to 1104 clicks in 4 months

Dominiqueflight-sensations-idf.comGoogleLeisure and aviation

0 to 163 clicks in 6 months

Coworking Pariscoworking-paris.frGoogleOffice broker

x92 clicks in 7 months

Guide Zanzibarguidezanzibar.comGoogleTravel