Free tool
301 Redirect Generator for Apache, Nginx and Cloudflare
This 301 redirect generator turns a pasted list of old and new URLs into ready-to-use rules for Apache .htaccess, Nginx or Cloudflare Bulk Redirects. It also handles the parts most generators skip: whole folders with regex (pattern matching), 410 "gone for good" responses, query strings, and a check that flags chains and loops before you upload anything.
Everything runs in your browser. Nothing you paste is sent anywhere.
How to use the 301 redirect generator
- Paste your map. One redirect per line: old URL, then new URL, separated by a comma, tab or space. Copying two columns straight out of Google Sheets or Excel works.
- Pick your server. Apache (mod_rewrite, best for WordPress), Apache (mod_alias), Nginx, or Cloudflare Bulk Redirects CSV.
- Pick the status code. 301 for most moves, 308 if forms post to the old URL, or put
410in a third column on any line that should return "gone" instead. - Read the warnings. Chains, loops, duplicates and Cloudflare limits show up above the output.
- Copy or download the rules, and the test script that comes with them.
Not sure which status code fits? Google treats 301 and 308 as permanent and uses them as a signal that the new URL should rank. 302 and 307 are temporary, so they're left out of this tool on purpose.
What the output looks like
Paste this:
/old-page, /new-page/
/blog/*, /news/*
/summer-sale-2019, 410And on Apache you get rules ready to sit above the # BEGIN WordPress block. On Nginx you get location blocks with return. On Cloudflare you get a CSV that uploads straight into a Bulk Redirect List. The full formats are in the spec at the bottom of this page.
The rules this generator follows
These are the same habits I use when I build redirect maps by hand on client migrations:
- Every target is an absolute
httpsURL. A relative orhttptarget adds a second hop later. - Specific rules come before folder rules. Apache stops at the first match with the
[L]flag, so a folder rule placed first would swallow the exceptions. - Query strings are dropped unless you say otherwise. By default, mod_rewrite copies the old query string onto the new URL, which is how
?id=42ends up indexed forever. TheQSDflag handles it. - Old URLs that point at another old URL get flagged. That's a chain, and Google's site-move guide says to redirect to the final destination directly. The tool offers to collapse it for you.
- 410s are real 410s. On Nginx that's
return 410, which thereturndirective supports directly. Not a redirect to the homepage.
Cloudflare limits to know first
Cloudflare Bulk Redirects are great for long lists of exact URL pairs, with three catches. They don't accept a header row in the CSV. They can't use regex, so folder rules become "subpath matching" rows instead. And they can't return a 410, so the tool lists those lines separately for your origin server.
Plan size matters too. As of October 2026, Cloudflare allows 10,000 URL redirects across lists on the Free plan, 25,000 on Pro and 50,000 on Business. The tool warns you when your list goes past the Free limit.
When to call a pro instead
The generator writes correct rules. It can't tell you whether your list is complete, and that's where migrations lose traffic. A good map pulls old URLs from Search Console, analytics, backlink exports, old sitemaps and server logs, not just today's menu. My step-by-step migration checklist walks through building that list.
If you want the background on each pattern, the htaccess redirect cheat sheet explains every rule the tool writes. And if traffic already fell after a move, start with why traffic drops after a migration before adding more redirects.
If you'd rather have me build and test the full map, that's part of a domain change or replatform migration, starting at $2,500 with the SEO redirect map and 30 days of monitoring. You can send me your move details here, and I reply with a plan and a fixed quote within one business day.
301 Redirect Generator FAQs
Is this 301 redirect generator free?
Yes. It runs entirely in your browser, needs no sign-up, and doesn't send your URLs to a server. Paste as many lines as you like, though very large lists (tens of thousands of rows) may be slow on older laptops. For Cloudflare, the tool warns you when the list goes past your plan's limit.
Can it make redirects for a whole folder?
Yes. End both the old and new path with /*, such as /blog/*, /news/*. On Apache and Nginx the tool writes a regex rule that keeps everything after the folder name. On Cloudflare it writes a subpath-matching row with the path suffix preserved, because Bulk Redirects don't support regex.
Should I use 301 or 308?
Both are permanent, and Google treats both as a signal that the new URL should be the one in search. The difference is technical: a 308 forces browsers to repeat the same request method, so a form that posts to the old URL keeps posting. For ordinary pages, 301 is the safe default and works everywhere.
Where do I paste the Apache rules on WordPress?
In the .htaccess file in your site's root folder, above the line # BEGIN WordPress. Back up the file first. A typo in .htaccess can take the whole site down with a 500 error, so reload a few pages right after saving, then run the test script the tool gives you.
Want a second pair of eyes on your site?
Tell me what's going on in the website migration questionnaire. I reply with a plan and a fixed quote within one business day.