XConvert
Downloads
Pricing

Generate .HTACCESS Online

Create an .htaccess file right in your browser and download it instantly for use on Apache servers.

Redirects
One per line: "/old /new"
Performance
Security
Error pages
Generated .htaccess21 lines
<IfModule mod_rewrite.c>
RewriteEngine On
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# Gzip compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json application/xml application/rss+xml 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/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 1 hour"
</IfModule>

.htaccess Generator — Redirects, Rewrites, Headers, Cache, Compression

Build Apache .htaccess rules from common templates: 301 redirects, force HTTPS, force www / non-www, hotlink protection, gzip / Brotli compression, browser-cache headers, custom error pages, and mod_rewrite URL rewriting. Pick the rules you need, fill in parameters, and copy the rendered block.

Related Generate tools
Robots Txt GeneratorSitemap GeneratorMeta Tag GeneratorJson Ld Schema GeneratorChmod Calculator

Image Tools

Image CompressorCompress JPEGCompress PNGCompress GIFCompress WebPImage ConverterImage Resizer

Video Tools

Video CompressorCompress MP4MP4 to GIFVideo to GIFVideo ConverterVideo Cutter

Audio Tools

Audio CompressorCompress MP3Compress WAVAudio ConverterFLAC to MP3Audio Cutter

Document Tools

Compress PDFMerge Images to PDFSplit PDFPDF to JPGUnzip FilesRAR Extractor
© 2026 XConvert.com. All Rights Reserved.
About UsPrivacy PolicyTerms of ServiceContactHelp Us Grow