How to use the .htaccess Generator
- Tick the features you need.
- Add redirects as “from to” pairs.
- Copy the file to your site's root folder — after backing up the old one.
What does this tool do?
.htaccess files configure Apache and LiteSpeed hosting (common on shared hosts and WordPress). Rules are wrapped in IfModule checks so missing modules don't break the site, and sensitive files like .env and .git are blocked when security headers are on. Test on a staging site first.
Everything runs in your browser — nothing you paste is uploaded.
Why use it?
- HTTPS and www rules.
- Bulk redirects.
- Caching and security headers.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Last reviewed by the M2Toolkit team.