Free SEO tool · Technical · Migrations
301 redirect generator for safer site migrations
Paste your old URL → new URL pairs and get ready-to-upload rules for Apache, nginx, Cloudflare, WordPress or CSV — with loops, chains and conflicts detected, plus a tester that follows the redirect hop by hop.
One pair per line. Accepted separators: tab, comma, semicolon, → or space. URLs can be paths (/page) or full URLs; a CSV header row is optional, as is a third field with the status code (301, 302, 307, 308 or 410) on each row. Lines starting with # are comments; sources containing * automatically move to the wildcard rules.
“Path only” writes /new-page/ (same domain). “Full URL” adds the new domain, which is needed when the site changes domain or moves from http to https.
Advanced: wildcard rules and removed pages (410)
A * captures the rest of the URL, and you reuse it in the destination as $1, $2…: /old-blog/* → /blog/$1. Exact rules take priority, and specific wildcard rules are placed before general ones.
One URL per line, no destination (* is accepted too). Use 410 only for pages with no equivalent.
| # | Source | Destination | Code | Status |
|---|
Honest note: the tool generates rules; it does not test them on your server. The outcome depends on your setup (CMS, cache, CDN, other existing rules). Load the rules on a staging environment first, check them with curl -I or a crawler, and watch the indexing report in Search Console after launch.
301, 302, 307 or 308: which code to choose
A redirect is a server response telling the client where a page has moved. 301 and 308 mean “moved permanently”: Google treats them as a strong signal that the destination is the new canonical URL. 302 and 307 mean “temporary”: the old URL stays the main one. The difference between 301 and 308 (and between 302 and 307) is that the newer codes preserve the HTTP method, which matters for forms and APIs rather than ordinary pages. For a migration or a URL change, pick 301; for the cases where a temporary redirect makes sense, read the guide to 301 and 302 redirects.
The 410 code is not a redirect: it says the page was removed on purpose and has no equivalent. Use it only for URLs that truly have nowhere to go.
A redirect plan for a migration
The basic rule: a 1:1 map, each old URL pointing to the closest equivalent page on the new site. Start from a full list of old URLs (a crawl, the sitemap, pages with traffic in analytics, pages with external links), then match them one by one. Sending every page to the homepage does not help the visitor and may be treated by Google as a soft 404; such pages can show up in the page indexing report in Search Console, and the guide to pages that are not indexed explains what to do with them. If a page has no equivalent, an honest 404 or 410 beats a forced redirect.
The complete migration plan — inventory, map, testing, monitoring — is in the article on migrating a site without losing SEO. If you are rebuilding the site as well, building an SEO-optimized website includes the redirect map from day one.
Chains, loops and rule order
- A chain (A → B → C) appears when a destination was itself moved later. Every hop adds delay, and Googlebot follows only a limited number of consecutive redirects (Google’s documentation mentions up to 10 hops). The “Flatten chains” option writes A → C directly; update internal links to point at the final URL too, and if two URLs end up showing the same content, see canonical tags and duplicate content.
- A loop (A → B → A, or A → A) never ends: the browser shows a “too many redirects” error. The tool detects them and keeps them out of the output.
- Order matters. Exact rules must come before wildcard rules, and specific ones (
/blog/2018/*) before general ones (/blog/*); otherwise the general rule takes the requests. The tool orders them automatically, but check the result. In Apache,Redirectalso matches sub-paths, which is whyRewriteRuleis the default variant. - Query strings (
?id=12) are not part of the path: servers handle them separately, and fragments (#) never reach the server at all.
How long to keep redirects
As long as you can. For site moves, Google recommends keeping them for at least a year (longer if possible), but external links, bookmarks and engines that still hold the old URLs keep sending visitors well after that. A redirect costs almost nothing, so delete one only after checking that it no longer receives requests.
What the tool does and does not do
The tool turns your list into rules for Apache, nginx, Cloudflare Bulk Redirects (a CSV list; check Cloudflare’s documentation for its current format), the WordPress Redirection plugin or CSV, and flags the obvious problems. It does not test the rules on your server: the outcome depends on your setup (CMS, cache, CDN, other rules already in place). Load the rules on a staging environment first, check with curl -I or a crawler, and watch Search Console after launch. Redirects are part of technical SEO; if you want someone to review them together with the rest of the site, see technical SEO optimization or an SEO audit, and for multilingual sites add the hreflang generator.
Frequently asked questions
Frequently asked questions about 301 redirects
What is the difference between a 301 and a 302 redirect?
301 (and 308) means “moved permanently”: Google treats it as a strong signal that the destination is the new canonical URL. 302 (and 307) means “temporary”: the old URL stays the main one. For migrations and URL changes you use 301; details and examples are in the guide to 301 and 302 redirects.
Can I redirect all old pages to the homepage?
It is not recommended. A visitor looking for a product or an article does not find it on the homepage, and Google may treat a large number of such redirects as soft 404s. Send each URL to the closest equivalent page; if there is none, a 404 or 410 is more honest. See also pages not indexed in Search Console.
What is a redirect chain and why flatten it?
A chain appears when A redirects to B and B redirects to C. Each hop adds delay and a chance of failure, and Googlebot follows only a limited number of consecutive redirects (Google documents up to 10 hops). Flattening writes A → C directly. Fix internal links to point at the final URL too; if two URLs show the same content, also check the canonical tag.
How long should I keep redirects in place?
As long as possible. For site moves, Google recommends at least a year, and external links and old bookmarks keep sending visitors much later. The full plan for a move is in the article on migrating without losing SEO.
Does the tool test the rules on my server?
No. It generates the rules and simulates locally, in your browser, what would happen to a URL; it sends no requests to your server. Load the rules on a staging environment first, check them with curl -I or a crawler, and watch Search Console after launch. For a specialist review, see technical SEO optimization.
SEO Lab
More free tools
robots.txt & llms.txt generator
Control which crawlers and AI bots can access your site — plus an llms.txt file for GEO.
Open the tool →Text cleaner & slug generator
Clean up text (quotes, spaces, case) and generate tidy URL slugs from titles.
Open the tool →Hreflang tag generator
Reciprocal hreflang tags for multilingual sites — as HTML, HTTP headers or sitemap entries, with validation.
Open the tool →Want a specialist to look at the results?
Tools show you the symptoms. We find the causes and fix them: send us your website address and get a free initial analysis.
[email protected] · +40 771 430 955