Webmaster Tools•Free Online Tool
.htaccess File Generator
Visual .htaccess configuration generator for Apache web servers. Easily configure 301/302 redirects, force HTTPS, toggle www, enable Gzip, browser caching, and prevent hotlinking.
100% Free & Private
Common Rules
Redirects
.htaccess Output
# Generated by Vesso Tools .htaccess Generator
# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Enable Gzip Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json application/xml image/svg+xml
</IfModule>
# Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/webp "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 0 seconds"
</IfModule>
How to Use .htaccess File Generator
1
Input & Parameters
Select HTTPS redirection, www handling, and browser caching.
2
Automatic Calculation
Enter source and destination paths for 301 permanent redirects.
3
Review & Copy
Copy the generated directives into your server .htaccess file.
Frequently Asked Questions
Related Tools
Robots.txt Generator
Create clean, valid robots.txt files to guide search engine crawlers.
Use Now
Redirect Chain Checker
Trace 301 and 302 redirect chains to uncover redirect loops and canonical destinations.
Use Now
XML Sitemap Generator
Generate search engine XML sitemaps with custom change frequencies, priority, and lastmod tags.
Use Now
HTTP Status & Header Checker
Inspect HTTP response status codes (200, 301, 302, 404, 500) and response headers securely.
Use Now