What is the .htaccess Redirect Generator?
Generate Apache .htaccess 301 redirects, HTTPS and www rules. Correct 301 redirects keep visitors and search engines on the right URLs when pages move or a site changes domain.

How to use the .htaccess Redirect Generator
- Paste or type your redirects into the box (a sample is pre-filled so you can see how it works).
- Tick the options you need: force https.
- Results update automatically as you type; you can also press Calculate.
- Read the output: .htaccess.
- Use the 📊 chart to see the result visually, then copy or share it.
Formula and method
Where the .htaccess Redirect Generator helps in real life
You renamed a page from /services.html to /services/. Generating a 301 rule keeps old links working and passes ranking signals to the new URL.
You want every visitor on the https, non-www version of your site. The generator builds the rules so you do not have to write regular expressions.
Common mistakes to avoid
- Chaining several redirects instead of pointing straight to the final URL.
- Using 302 temporary redirects for permanent moves.
- Creating redirect loops between www and non-www rules.
- Editing .htaccess without a backup.
💡 Practical tip: A typo in .htaccess can take a whole site offline — keep a copy of the working file ready to restore.

Tips for better results
- Back up your existing .htaccess before changing it.
- Test old URLs after uploading.
- Update internal links so they point to the new URLs directly.
Frequently asked questions
What does the .htaccess Redirect Generator do?
Generate Apache .htaccess 301 redirects, HTTPS and www rules.
How is it calculated?
The .htaccess Redirect Generator uses this method: Apache mod_rewrite + mod_alias Redirect 301.
Is the .htaccess Redirect Generator accurate?
Yes. It uses standard formulas and exact constants, and the results are verified by our automated test suite. Values are displayed to up to 12 significant digits.
Is this tool free and private?
Yes — the .htaccess Redirect Generator is completely free with no sign-up, and it runs entirely in your browser, so the values you enter are never uploaded to our servers.
Related tools
📬 Get new tools first — free
Join Taurang to hear about new calculators, converters and features. No spam; unsubscribe anytime.