⚙️ .htaccess Generator
Toggle checkboxes to build a production-ready Apache .htaccess in real time: HTTPS redirect, HSTS, gzip / brotli, cache headers, secret file deny, WordPress permalinks and more.
✅ 100% free · no signup · browser-only · nothing is uploaded
🔒 About Privacy
- ・All generation runs entirely inside your browser
- ・Domain names and settings are never sent to any server
- ・No logs, no tracking, no database
🧩 Choose features
📄 Generated .htaccess
📖 How to Use
-
1
Pick featuresTick the checkboxes for the features you need (HTTPS redirect, HSTS, gzip, etc). The preview on the right updates live.
-
2
Set your domainIf you enable www canonicalization, set your domain (e.g. example.com). Not required for HTTPS-only redirects.
-
3
Copy or downloadUse the buttons to copy to clipboard or download as a file. Always review before uploading.
-
4
Upload to your serverPlace the file as .htaccess in your document root (public_html / htdocs / public). Back up any existing file first.
❓ FAQ
Does .htaccess work on servers other than Apache?
No. .htaccess is Apache-only. LiteSpeed is compatible, but nginx needs a server block instead — try our nginx config generator.
What if I get a 500 error?
It can happen when a module is missing (e.g. no mod_brotli). The blocks are wrapped in IfModule so they should be safe — but if you still see 500, comment out one block at a time and check Apache error_log.
Does it work on shared hosting (Xserver / Sakura)?
Yes. Most shared hosts allow .htaccess including PHP version selection (AddHandler). Some require enabling mod_deflate / mod_expires from the control panel.
🔗 Related Tools
🐛 Found a bug or issue with this tool?
Free to use, no signup. Even just the steps to reproduce are helpful. Reports go directly to the operator and help us fix issues.
✅
Thanks for your report!
Your report has been delivered to the operator and will be used to improve the tool.