.htaccess Builder
Generate Apache .htaccess directives using toggles. Force HTTPS, redirect www, enable GZIP compression, set browser caching, configure CORS, and more.
HTTPS & Redirects
Force HTTPS
Redirect all HTTP traffic to HTTPS
Force www
Redirect non-www to www
Trailing slash
Enforce or strip trailing slashes
Performance
GZIP compression
Compress HTML, CSS, JS, XML responses
Browser caching
Set Expires headers for static assets
ETag removal
Remove ETags (improves caching)
Security
Disable directory listing
Prevent browsing of directory contents
Security headers
X-Frame-Options, X-Content-Type, Referrer-Policy
Block hotlinking
Prevent other sites hotlinking your images
CORS
Allow cross-origin requests
Error Pages & Misc
Custom 404 page
Set a custom error document
Protect .htaccess
Block direct access to .htaccess file
.htaccess preview
Disclaimer: Free tool provided “as is” by MonitorGiant. No warranty or liability for any data loss, security issues, or infrastructure problems arising from use of this tool. Results are for informational purposes only. · A Free Tool by MonitorGiant
How .htaccess Builder works
- 1
Toggle the rules you need
- 2
Configure domain-specific values
- 3
Copy or download
All .htaccess content is generated in your browser. No data is sent to any server.
Comments & Feedback
Found a bug? Have a suggestion? We'd love to hear from you.
Related Tools
From the makers of this tool
Need deeper observability?
MonitorGiant tracks real-time AI performance, infrastructure health, and system reliability — far beyond what free utilities can show.