.htaccess Generator
Generate common Apache .htaccess rules (HTTPS, www, cache, gzip).
100% Free Forever
# Generated by Toolz.live
RewriteEngine On
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Disable directory listing
Options -IndexesFree .htaccess Generator
Generate common Apache .htaccess rules — HTTPS redirect, www/non-www, browser caching, gzip compression, hotlink protection, and more.
How to use this tool
- 1
Toggle rules you need
Each rule is independent.
- 2
Copy the generated code
Paste into your .htaccess file.
- 3
Upload to your server
Test thoroughly before going live.
Pro tips
- Always back up the existing .htaccess before replacing it.
Frequently asked questions
Does it work on Nginx?
No — .htaccess is Apache-only. Nginx uses its own config syntax.