Redirect Generator
Turn a list of old and new URLs into redirect rules for your server or host.
- Runs in your browser
- Nothing is uploaded
- Free, no sign-up
- line 6/old-a takes 2 hops to reach /final. Point it straight at /final.
Rules match the path only, exactly. 301 and 308 tell search engines the move is permanent and pass the old URL's ranking to the new one; use 302 or 307 only if the page will come back.
About this tool
Write your redirects once as a plain list of old and new addresses, and get the rules for Apache, nginx, Netlify and Cloudflare Pages, Vercel or Next.js. The list is checked for duplicates, chains and loops, which are the mistakes that make migrations lose traffic.
How to use it
- Write one redirect per line: the old path, then the new path or a full URL.
- Choose where the rules will run and the default status code.
- Fix anything listed under the output, then copy the rules into place.
Writing the list
Put the old path first, then the new one, separated by a space, a comma or an arrow. A status code at the end overrides the default for that line:
/about-us /about
/blog/2019/old-post -> /blog/new-post
/products/widget-v1, /products/widget, 302
/careers https://jobs.example.com/
The old address is a path starting with /, matched exactly. A query string cannot be part of it, because these servers match on the path alone. The new address can be a path or a full URL.
Which status code?
| Code | Meaning | Use it when |
|---|---|---|
| 301 | Moved permanently | A page has a new home for good. Search engines transfer the old URL's standing to the new one |
| 308 | Permanent, same method | Like 301, but a POST stays a POST |
| 302 | Found (temporary) | The old URL will return, such as during maintenance |
| 307 | Temporary, same method | Like 302, but a POST stays a POST |
For a site migration or a renamed page, use 301. Browsers cache a permanent redirect aggressively, so test before you ship it.
Chains and loops
A chain is a redirect that lands on another redirect: /a to /b to /c. It works, but every hop costs a request and a little of the signal, and Google follows no more than ten hops before giving up. Point /a straight at /c. The Shorten chains option does that for the whole list.
A loop is a redirect that eventually returns to where it started. Browsers stop with an error, and so do crawlers. Loops are reported as errors and removed when you shorten chains.
Before you ship
- Test with
curl -I https://example.com/old-pathand check the status and theLocationheader. - Redirect to the closest equivalent page, not to the home page. Google treats a mass redirect to the home page as a soft 404, and visitors lose their place.
- Keep redirects for at least a year, and longer while old links are still being followed.
- Handle the host and scheme separately. These rules match paths. Redirecting
httptohttps, orwwwto the bare domain, is a different rule.
Frequently asked questions
Where does the Apache output go?
In the .htaccess file in your site's root. It needs mod_rewrite, which most hosts enable. The rules match the path with an optional trailing slash.
Is the query string kept?
In Apache, yes: if the destination has no query of its own, the original is appended. The nginx output keeps it explicitly. Other hosts differ, so test with a URL that has one.
Can I redirect a whole directory?
These rules are exact matches, one per URL. Pattern-based redirects of whole directories need a rule written for your server, as getting one wrong can redirect more than intended.
Is my list uploaded?
No. The rules are generated in your browser.
Related tools
Robots.txt Tester
Check whether a URL is blocked for Googlebot, Bingbot, AI crawlers and more.
XML Sitemap Generator
Create a valid XML sitemap from a list of URLs, split automatically when large.
URL Encoder & Decoder
Percent-encode and decode URLs, full strings or single components.
URL Slug Generator
Turn titles into clean, URL-safe slugs.