.htaccess Redirect Generator
Generate Apache .htaccess rules for 301 redirects, www, HTTPS and slash handling.
Loading tool…
About this tool
Generate battle-tested Apache rules without memorizing mod_rewrite syntax: single 301s, bulk redirect maps, force-HTTPS, force-www or non-www, trailing-slash normalization and full domain migrations — plus the nginx equivalents for each rule.
How to use the .htaccess Redirect Generator
- Choose the redirect type or paste a bulk old→new URL list.
- Copy the generated .htaccess (or nginx) rules.
- Add them to your server config and test with our Redirect Checker.
Frequently asked questions
Where does .htaccess go?
In the directory it should govern — usually the web root. Apache must have AllowOverride enabled.
Will these rules slow my site?
A handful of rules is negligible; for thousands of redirects prefer a RewriteMap or server-level config.