.htaccess & Nginx Redirect Rule Generator
Turn a list of old and new paths into Apache .htaccess and Nginx 301 redirect rules.
Paste a migration map once and copy the rules for both servers.
How to use this tool
When you move or rename pages you need redirect rules in your server format. Paste a list of old and new paths and copy ready-made Apache and Nginx rules.
- Type or paste one redirect per line in the Redirect Map box, as /old-path -> /new-path.
- Check the generated rules in the dark panel on the right.
- Press Copy Rules.
- Paste the Apache lines into .htaccess or the Nginx lines into your server block, then test a few URLs.
What it checks
- Apache lines in the form Redirect 301 /old /new, after a RewriteEngine On line.
- Nginx rewrite lines with the permanent flag.
- The separator can be ->, a comma or whitespace.
- Every rule is created as a 301 permanent redirect.
- Lines missing a source or a target are skipped.
Questions
Does it produce vercel.json?
The generator builds a vercel.json structure internally, but this page only shows and copies the Apache and Nginx rules.
Can I choose 302 or another status?
Not in this page. All rules are 301 redirects.
Does it test the redirects?
No. It only writes the rules. Test them on your server after deploying and watch for redirect chains.