301 Redirect Rule Generator
Turn a list of old and new URLs into redirect rules for Apache htaccess, Nginx, Cloudflare or Netlify. Detects redirect chains and loops before you deploy them, and handles bulk migrations from a pasted list.

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^old-blog/post-one/?$ /blog/post-one [R=301,L] RewriteRule ^services/automation/?$ /services [R=301,L] RewriteRule ^tools/zapier/?$ https://bilalvirk.com/tools/zapier-cost-calculator [R=301,L] </IfModule>
Site migrations lose traffic in the redirect map, not in the design. Paste your old and new URLs as a two-column list and get deploy-ready rules for your server, with redirect chains and loops flagged before they reach production.
What this tool does
Paste a list of URL pairs — old on the left, new on the right, one per line — and choose your platform. You get a rule block for Apache .htaccess, an Nginx server block, Cloudflare bulk redirect rows, or a Netlify _redirects file.
Before it emits anything it checks the map for two problems that only surface after deployment: chains, where A redirects to B and B redirects to C, and loops, where the map eventually points back at itself. Both are listed with the exact lines involved.
A worked example
Paste:
/old-blog/automation-guide /blog/workflow-automation
/blog/workflow-automation /blog/what-is-workflow-automationThe tool flags a chain. Any request for the first URL takes two hops, which costs latency and, on a large map, adds up to a genuine crawl budget problem. The fix it suggests is to rewrite the first rule to point straight at the final destination, collapsing two hops into one.
It also spots the trailing-slash trap: a rule redirecting /page to /page/ on a server that already appends the slash produces an infinite loop.
Output formats
| Platform | Format produced |
|---|---|
| Apache | Redirect 301 or RewriteRule inside .htaccess |
| Nginx | return 301 inside a location block |
| Cloudflare | Source and target rows for a bulk redirect list |
| Netlify | _redirects lines with the status code |
Where people go wrong
Redirecting everything to the homepage. It is the fastest way to throw away the value of an old URL. Google treats a redirect to an irrelevant page as a soft 404. Map each URL to its closest equivalent, and let the ones with no equivalent return a proper 410 or 404.
Using 302 for a permanent move. A 302 says "this is temporary, keep the old URL indexed". For a migration you want 301. Google's redirect documentation sets out which status code signals what, and the underlying semantics are defined in RFC 9110.
Leaving chains in place after a second migration. Two migrations in three years and every old URL is three hops from its destination. Flatten the map each time rather than layering rules.
Redirecting to a URL that is not canonical. The target should be the canonical URL, and it should return 200. Build the two together with the canonical tag generator.
Deleting the old sitemap immediately. Keep it live for a few weeks. It is how Google finds the old URLs in order to discover the redirects.
FAQ
301 or 308?
301 for almost everything. A 308 preserves the request method, which matters for POST endpoints and almost never for content URLs. Search engines treat both as permanent.
How long should redirects stay in place?
At least a year, and there is rarely a good reason to remove them at all. External links to the old URL do not expire.
Do redirects lose ranking value?
Google has stated for years that PageRank is not diluted through 301 redirects. What does cost you is the chain, the mismatch between old and new content, and the mistake of pointing everything at one page.
Can I redirect with query strings?
Yes, but the syntax differs by platform. Apache needs RewriteCond %{QUERY_STRING}; Nginx matches on $args. The generator emits the correct form for the platform you select.
Should I redirect http to https and www to non-www?
Yes, and do it once at the server level rather than per URL, so a single rule handles the whole site. Then make sure your canonical tags reflect the chosen version.
Next steps
After deploying, confirm nothing important is now blocked using the robots.txt tester, regenerate your sitemap with the new URLs, and re-check the head on key pages with the On-Page SEO Auditor.
If the migration is part of a larger systems change, API Automation for Businesses covers keeping the tools around the site in sync.
Migrating a site with thousands of URLs? Book a discovery call.

Want this built against your real numbers?
A 30-minute call to scope the workflow, agent, or automation you actually need.
More seo tools
All toolsCanonical Tag Generator
Generate a correct rel=canonical tag from any URL. Normalises the scheme, strips tracking parameters, resolves trailing slash and case issues, and warns about the canonical mistakes that quietly deindex pages.
Content Brief Generator
Generate a complete SEO content brief from any keyword — ready to hand to a writer
Google SERP Preview Tool
See how your page will look in Google results on desktop and mobile before you publish. Renders the title link, breadcrumb URL and snippet with realistic truncation, and highlights query terms the way Google bolds them.
Hreflang Tag Generator
Build a complete, reciprocal hreflang set for a multilingual page and export it as link tags, an HTTP header block or XML sitemap entries. Validates language and region codes and adds x-default automatically.
Keyword Clustering Tool
Group any keyword list by search intent and topic — ready for content planning
Keyword Density Checker
Analyse the word and phrase frequency of any piece of content, with one, two and three-word groupings, stop words filtered out, and a flag on anything repeated often enough to read as keyword stuffing.
Have a workflow that's burning hours every week?
Bring me one real bottleneck. I'll tell you whether it's worth automating, and what it would take.