Htaccess generator
Switch on the sections you need and a valid Apache .htaccess assembles live below. Force HTTPS, www, gzip, caching, IP blocks, hotlink protection, basic auth and redirects — copy when done. Nothing is uploaded.
HTTPS & domain
Force HTTPSRedirect every http:// request to https://.
Force / strip www
Custom error pages
404 page path
500 page path
Performance
Enable gzip / deflateCompress text, HTML, CSS, JS and JSON responses.
Browser cache headersHow long browsers may cache static assets.
Images
CSS / JS
Fonts
Access & protection
Block specific IPsOne IP or CIDR per line.
Hotlink protectionOnly your domain may embed your images.
Your domain
Prevent directory listingStop Apache showing a folder’s file list.
Basic auth (password protect)Path to your .htpasswd file (created separately).
Realm name
.htpasswd path
Redirects
Redirect old → new URLs301 permanent redirects, one per row.
Your .htaccess
Everything runs in your browser. No upload, no sign-up.
How it works
STEP 1
Toggle the sections you need
Flip on force HTTPS, www rules, gzip, browser caching, IP blocks, hotlink protection, basic auth or redirects — each adds a labelled block.
STEP 2
Fill in any details
Where a section needs input — error-page paths, IPs, an allowed domain or redirect rows — type it in and the file updates instantly.
STEP 3
Copy your .htaccess
Copy the assembled file or download it, drop it in your site root, and Apache picks it up. Nothing leaves your device.