Back to Dashboard

.htaccess Generator

Generate Apache .htaccess configuration for security, performance, and SEO

SEO Optimized
Best for marketing sites
Security Focused
Maximum protection
Performance
Speed optimization
WordPress
WP specific rules
Custom
Start from scratch
Configuration
SSL / HTTPS
Force HTTPS
Redirect all HTTP to HTTPS
HSTS Header
HTTP Strict Transport Security
WWW Redirect
Compression
Enable GZIP
Compress text-based files
Enable Brotli
Modern compression (if supported)
Browser Caching
Enable Browser Caching
Set cache headers for static files
days
For images, CSS, JS, and fonts
Security Headers
X-Content-Type-Options
Prevent MIME type sniffing
X-Frame-Options
Prevent clickjacking attacks
X-XSS-Protection
XSS filter in browsers
Referrer-Policy
Control referrer information
File Protection
Protect .htaccess
Prevent access to .htaccess file
Block Sensitive Files
.env, .git, composer.json, etc.
Disable Directory Listing
Prevent browsing directories
SEO
Remove Trailing Slash
Redirect /page/ to /page
Remove .html Extension
Clean URLs for HTML files
WordPress
WordPress Permalinks
Standard WP rewrite rules
Block wp-config.php
Protect configuration file
Block XML-RPC
Disable xmlrpc.php access
Custom Rules
These rules will be added at the end of the file
Generated .htaccess
Important: Always backup your existing .htaccess before making changes. Test on a staging environment first.
# .htaccess