Redirect Generator
Move a page without leaving its visitors at a dead end. Turn an explicit old-path-to-new-URL map into readable server rules, then test those rules in the environment that will actually serve them.
An old address. A useful next step.
IN YOUR BROWSER / PRIVATE INPUTGood input. Useful output.
Build exact-path redirect rules for Apache, Nginx or Cloudflare.
Try the example, or make it your own.How to use the
Redirect Generator
- 01
Write the migration map
Enter an old path and an absolute destination URL on each line, separated by a comma. Use a specific replacement that serves the original visitor's intent.
- 02
Choose a server and status
Select Apache, Nginx or Cloudflare _redirects and the intended redirect code. The output formats exact-path mappings, not a general-purpose routing configuration.
- 03
Test before replacing live rules
Review the generated text in staging. Request every source path, inspect the status and Location header, then verify the destination returns the expected content.
Choose permanence and method behavior deliberately
For ordinary content migrations, first decide whether the move is permanent. For form endpoints and other non-GET requests, method handling also matters. This generator does not inspect the traffic your source route receives, so do not apply a page-migration rule to an API without reviewing its contract.
| Code | Intended move | Request-method consideration |
|---|---|---|
| 301 | Permanent | Clients may change a POST to GET. |
| 302 | Temporary | Clients may change a POST to GET. |
| 307 | Temporary | Preserves the request method. |
| 308 | Permanent | Preserves the request method. |
One page move in Cloudflare file format
A focused mapping is easier to review than a broad pattern. In this example, a retired guide points directly to its replacement. Request both the exact source and a similarly named path to confirm the rule does not catch more than intended.
/old-guide, https://example.com/new-guide
Server: Cloudflare _redirects
Status: 301/old-guide https://example.com/new-guide 301Generated syntax still needs its server context
Apache output uses an exact-path regular-expression rule; Nginx uses an exact location with a return directive. Cloudflare output uses source, destination and status on one line. These forms are not interchangeable and they are not complete server configuration files.
Existing rule order, rewrites, trailing-slash handling and application routing can change the effective result. Query-string handling also depends on the server and the rules already present. Test important query-bearing URLs rather than assuming a campaign parameter will be retained exactly as you expect.
A migration checklist that catches expensive mistakes
Avoid redirect chains
Map the original address directly to the final destination. If A goes to B and B later moves to C, update A where possible rather than accumulating another hop.
Check for loops
A source and destination that resolve back to one another cannot complete. Follow the full redirect path, including redirects from your CDN and application.
Do not send every removed page home
A generic homepage often fails to satisfy the original request. Choose a relevant replacement or intentionally return an appropriate removal response.
Update your internal references
Redirects protect old links, but your current navigation, canonical URLs and sitemap should normally point directly to final pages.
Redirect Generator:
questions, answered.
Can this tool generate wildcard or regular-expression migrations?
It is designed for explicit exact-path mappings. Do not paste wildcard syntax and assume it creates a dynamic routing rule; use a reviewed server configuration for that requirement.
Will the generated file work on every Cloudflare Worker?
No. The _redirects format is for supported static-asset handling. Requests served by Worker code may need redirects implemented in that code or in an appropriate Cloudflare Rules product.
Should I use 302 while a page is being permanently replaced?
Use a temporary status for an intentionally temporary move. If the replacement is permanent, select the corresponding permanent status after checking the migration requirements.
Does generating a rule install it on my server?
No. The output is a file or snippet for review. Deployment, configuration testing and rollback remain part of your hosting workflow.
The calculations and checks above describe this tool's implementation. Use these primary references for the underlying formats and publishing guidance.
Cloudflare static-asset redirects ↗ (opens in a new tab)Redirects and Google Search ↗ (opens in a new tab)Give every moved page a destination.
Build the map, check the server syntax and verify the complete request path before release.
Use the Redirect Generator↑