Skip to content

⚙️ .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

🧩 Choose features

📄 Generated .htaccess


        
    

📖 How to Use

  1. 1
    Pick features
    Tick the checkboxes for the features you need (HTTPS redirect, HSTS, gzip, etc). The preview on the right updates live.
  2. 2
    Set your domain
    If you enable www canonicalization, set your domain (e.g. example.com). Not required for HTTPS-only redirects.
  3. 3
    Copy or download
    Use the buttons to copy to clipboard or download as a file. Always review before uploading.
  4. 4
    Upload to your server
    Place 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.
🐛 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.

* Browser info (UA / screen / language / URL) is sent automatically to help reproduce the issue