// Developer Tool

HTACCESS GENERATOR

Toggle the Apache rules you need — force HTTPS, www or non-www, caching, compression, redirects and more — and get a clean, copy-ready .htaccess file. Everything is assembled live and runs entirely in your browser.

Rules
Force HTTPS
Redirect all HTTP traffic to HTTPS (301).
Force www / non-www
Canonicalise the hostname to a single preferred form.
Custom error pages
Serve your own pages for 403, 404 and 500 errors.
Leave any field blank to skip that error code.
Gzip / Deflate compression
Compress text, HTML, CSS, JS and fonts with mod_deflate.
Browser caching (Expires)
Set far-future expiry headers for static assets.
Block directory listing
Stop Apache from showing folder contents (Options -Indexes).
Hotlink protection
Block other sites from embedding your images.
Custom 301 redirects
Permanently redirect old paths to new locations.
“From” is a path on your site (e.g. /old-page). “To” can be a path or a full URL.
Generated .htaccess
Toggle a rule above to build your file.
# All rules are off — enable one above.

Place this file in your site's root directory. Always keep a backup of your existing .htaccess before replacing it. Rules relying on mod_rewrite, mod_deflate or mod_expires require those Apache modules to be enabled on your server.