Redirect generator
An old → new map as .htaccess, nginx or a plain list, locally in your browser
- Free
- No account required
One pair per line. Separate with a space, tab, comma or arrow. Lines starting with # are skipped.
Validation
Paste your redirect map
An old URL and a new URL on one line. Validation and generation run locally and nothing is uploaded.
Review before deploying. The rules are anchored, so /old will not also redirect /old/subpage, the usual side effect of a plain Redirect.
Rules appear once you paste a map…
This redirect generator turns a pasted old → new map into .htaccess rules, nginx locations or a plain list. On the way it checks what actually breaks migrations: chains, loops, the same source mapped twice, and pages redirected to themselves. It runs locally and nothing is uploaded.
What breaks a URL migration
Chains are what several migrations in a row leave behind: /a goes to /b, /b goes to /c. Every hop is another request and more latency, and a long enough chain can stop a crawler before the end of it. Collapse everything to one step straight to the final URL.
A plain Redirect also covers subpages. Apache matches whole path segments, so Redirect 301 /old /new does not catch /old-pricing, but it does move /old/subpage to /new/subpage. That is why this generator emits an anchored RedirectMatch with ^ and $, which redirects that one address only.
301 redirects do not lose PageRank: Google said so in 2016. Chains are worth shortening for speed and reliability, not because they "leak link equity".
Validation works on the list you paste. The tool fetches nothing, so it cannot tell you whether a target returns 200. Check that separately after deploying.
Prepare the map before migration
Match each old URL to a page with the same purpose or the closest relevant content. Avoid redirecting every removed page to the homepage. Review loops, duplicates and chains before generating configuration.
How to plan 301 redirects for a URL change
You prepare 301 redirects from a map where every old URL has one new counterpart. Five steps take you from a list of URLs to rules checked after deployment.
-
Collect the old URLs
Export URLs from your current sitemap, your CMS and the pages report in Search Console. Add URLs that external links point to, because those are the ones most often lost in a migration.
-
Map each URL to its closest counterpart
An old URL points to the page with the same content. Google advises against sending many old URLs to one unrelated destination. Merging several pages into one new page is fine.
-
Paste the map and fix the issues
The generator above takes old and new URL pairs, one per line. It flags chains, loops, one source mapped to two targets and pages redirected to themselves. Fix them in the map before you copy the rules.
-
Pick your server format and deploy the rules
For Apache you get anchored
RedirectMatch 301rules for .htaccess, for nginxlocation =blocks withreturn 301, and for a CDN a CSV list. Everything is generated locally in your browser. -
Check the live responses
After deployment, test a few URLs in the redirect checker: the old URL should return 301 and the target 200. Also update internal links, canonicals and the sitemap to the new URLs.
Redirect rule examples
Rules in the formats this tool generates, plus a shortened chain.
RedirectMatch 301 ^/old-pricing/?$ /pricing
RedirectMatch 301 ^/blog/post\.html/?$ /blog/post ^ and $ make the rule match only that one path, with or without a trailing slash.
location = /old-pricing {
return 301 /pricing;
} The = modifier defines an exact match of the URI. nginx then stops searching other location blocks.
/a /b
/b /c/a /c
/b /cEvery old URL goes straight to the final URL. Google advises redirecting directly to the final destination.
Common redirect mistakes
-
A temporary redirect for a permanent change
Google uses 301 and 308 redirects as a signal that the target should be canonical. 302 and 307 carry no such signal. A plain Apache
Redirectrule without a status code returns exactly that 302. -
Every old URL sent to the home page
Google advises against redirecting many old URLs to one unrelated destination such as the home page. A user looking for specific content lands on a general page instead.
-
Chains after repeated migrations
Google recommends redirecting straight to the destination, and for chains ideally no more than 3 hops and always fewer than 5. After each migration, rewrite old rules to point at the new final URLs.
-
Removing rules too early
Google recommends keeping redirects as long as possible, generally at least one year. Links from other sites and user bookmarks work only as long as the rules do.
-
Redirects in JavaScript
Google picks them up only if the page renders, and recommends them as a last resort. A server-side rule works on every request.
Redirect status codes and Google recommendations
| Value | What it means | Source |
|---|---|---|
| 301, 308 | Permanent redirects. Google treats them as a signal that the target URL should be canonical. | Google Search Central, redirects |
| 302, 303, 307 | Temporary redirects. They do not tell Google that the target should become the canonical URL. | Google Search Central, redirects |
| 1 year | Minimum time Google recommends keeping redirects after a URL change. | Google Search Central, site moves |
| Fewer than 5 | Number of hops a redirect chain should have according to Google, ideally no more than 3. | Google Search Central, site moves |
| 302 | The code Apache’s Redirect directive returns when you give no status. | Apache HTTP Server, mod_alias |
| POST to GET | After a 301 response to a POST request, the browser may repeat it as GET. A 308 prohibits changing the method. | MDN, 301 Moved Permanently |
Sources checked:
What can go wrong
- →→Chain
- /a goes to /b and /b goes to /c. It works, at the cost of one extra request per hop.
- ↻Loop
- /a goes to /b and /b goes back to /a. The browser gives up with an error and the URL is unreachable.
- 2×Duplicate source
- The same old URL on two lines with different targets. The first rule wins.
- ^$Anchoring
- Without ^ and $ a RedirectMatch pattern matches anywhere in the path, so /old also catches /old-pricing and /archive/old.
Paste your old → new map, one pair per line, and pick the Apache format. The tool validates the map and generates anchored RedirectMatch rules ready to paste into an .htaccess file. Everything is computed locally in your browser.
Because Redirect also moves everything under that address: a rule for /old covers /old/subpage and any other path in that directory. RedirectMatch with ^ and $ matches that one path exactly, with an optional trailing slash.
Not through lost PageRank. Google confirmed in 2016 that 3xx redirects do not lose it. It hurts performance: every hop is another request, and a long enough chain can stop a crawler before it reaches the destination.
No. It runs locally on the list you paste and fetches nothing, so it cannot confirm a 200 or that the target exists. It checks what is visible in the map itself: chains, loops, duplicates and self-redirects.
RedirectMatch matches the path only; Apache appends the query string to the target. If the rule needs to depend on a parameter, that takes a separate RewriteCond on %{QUERY_STRING} before a RewriteRule.
A 301 redirect is enough for regular pages that browsers fetch with GET, and Google treats 301 and 308 the same way as permanent redirects. Use 308 for URLs that accept POST, such as forms or APIs, because it prohibits changing the method. The generator writes 301, so change the code by hand for those URLs.
Google recommends keeping redirects after a migration as long as possible, generally at least one year. From the user’s point of view it makes sense to keep them indefinitely, because old links and bookmarks keep working for years.
A single-URL redirect in nginx is a location = /old-url block with a return 301 /new-url directive inside. Choose the nginx format in the generator to get ready blocks for the whole map, to paste into your server configuration.
What else might come in handy
File or code ready? Check the result on the live page
Indexability, metadata and structure, with priorities and a client report.