UT
UsefulToolkit
Home
About
Contact
Blog
Home
About
Contact
Blog
Home
/
Developer Tools
/
.htaccess Generator
.htaccess Generator
Generate .htaccess rules for HTTPS, caching, gzip, redirects, and more.
Force HTTPS
Enable Gzip
Browser Caching
Custom Error Pages
Block Hotlinking
WWW Redirect
None
Add www
Remove www
Index File
Domain
.htaccess Output
Copy
# Generated .htaccess RewriteEngine On # Force HTTPS RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Enable Gzip Compression <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json image/svg+xml </IfModule> # Browser Caching <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" ExpiresByType text/html "access plus 1 hour" </IfModule> # Default Index DirectoryIndex index.html # Custom Error Pages ErrorDocument 404 /404.html ErrorDocument 403 /403.html ErrorDocument 500 /500.html