The Tool Guru
Tools
▾
Blog
About
Contact
Get Started
.htaccess Generator
Generate common Apache .htaccess rules (HTTPS, WWW redirects, caching) and add your own.
Force HTTPS
Host redirect
None
non-www → www
www → non-www
Add caching headers for static files
Add basic CORS headers
Enable gzip compression
Block access to dotfiles
Custom rules
.htaccess
Copy
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] <FilesMatch "^..*"> Require all denied </FilesMatch>