htaccess Generator
Generate Apache .htaccess files for redirects and security
Input & options
Custom redirects
Your inputs are never uploaded or stored.
Results
Enter your values to see the result.
How to use htaccess Generator
Tick "HTTPS redirect", set "www redirect" to "Add" or "Remove", and click "Add redirect" for each moved page: fill "Redirect from" and "Redirect to", then choose 301 for a permanent move or 302 for one you may undo. Check the other boxes, then use "Copy all" or "Download" to get a file named .htaccess. Test with 302 first, because browsers keep a 301 for a long time. A redirect matches the start of a path, so /old also catches /old/page. The file is for Apache, and nginx ignores it. One bad line can break every page, so keep a copy of your old file. Nothing you enter is uploaded.