Apache .htaccess Generator
Free online Apache .htaccess generator, no installation required. Visual configuration file builder
About HTAccess Generator
Assembles an Apache .htaccess file from toggleable modules: force HTTPS, WWW redirect direction, custom response headers, sensitive file blocking, cache control, gzip compression, directory listing prevention, and arbitrary 301/302 rewrite rules. Each enabled section is emitted as a commented, ready-to-paste block.
How to Use
1. Under Basic Settings, toggle Force HTTPS, Enable Cache, Enable Gzip, and Prevent Listing, then choose a WWW Redirect mode (None / To WWW / From WWW). 2. In Custom Headers, add Header Name + Value pairs. 3. In Block Files, add patterns like .env or .git. 4. In Rewrite Rules, enter from/to regex pairs with a 301 or 302 code. 5. Click Generate, then Copy the resulting .htaccess text.
Emitted Directive Reference
Prevent Listing writes `Options -Indexes`. Force HTTPS emits a RewriteCond on %{HTTPS} off plus an R=301 rule to https://%{HTTP_HOST}. WWW modes use RewriteCond against %{HTTP_HOST} with `!^www\.` (to WWW) or `^www\.` (from WWW). Custom Headers become `Header set KEY "value"`. Blocked files use `<Files name>` blocks with `Deny from all`. Cache wraps ExpiresByType directives inside `<IfModule mod_expires.c>`; gzip wraps AddOutputFilterByType inside `<IfModule mod_deflate.c>`.
▶Are the Cache Control expiry values fixed?
▶What gzip types does the tool compress?
▶How are custom rewrite rules ordered?
▶Is my data sent to a server?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee