.htaccess redirect generator
Use this .htaccess redirect generator to turn a list of old and new URLs into 301 rules for Apache, Nginx, Netlify, Vercel, Cloudflare or IIS. Chains and loops are flagged first.
Free, no account. The rules are written in your browser and the list is not sent.
Your .htaccess file
Paste your list, or try the example, to see the rules here.
A 301 redirect sends visitors and search engines from an old address to its new one and tells them the move is permanent. Paste two columns of old and new URLs. The generator writes the rules for your server, follows chains to their final address, drops loops and duplicates, and says which rules a host cannot express.
How this works
- Paste the list
- One redirect per line: the old address, then the new one, separated by a tab, comma, semicolon or spaces. A two column CSV or a copy from a spreadsheet works, and a header row is skipped. Old addresses can be paths or full URLs, up to 5,000 rows.
- Checks before writing
- The same old address twice is merged when both rows point to the same place; when they differ, the first row is kept. A redirect to itself is dropped. A chain such as A to B to C becomes A straight to C, and loops are left out because they never finish.
- Query strings
- A rule for a bare path matches that path with any query string. A rule with a query string matches only that query and is placed first. The Netlify and Cloudflare files written here match paths only, so those rows are left out of them and listed.
- Six formats
- Apache .htaccess with mod_rewrite, an Nginx server block, a Netlify _redirects file, a vercel.json with status 301, the CSV that Cloudflare Bulk Redirects imports and an IIS web.config with URL Rewrite rules.
Questions about redirects
Check your business in AI answers
Pages that crawlers can read and follow are the groundwork. The free AI visibility scan shows how assistants answer about your business and what to work on next.