# Enable Rewrite Engine
RewriteEngine On

# Redirect index.html to root
RewriteRule ^index\.html$ / [R=301,L]

# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Caching
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access plus 6 months"
  ExpiresByType image/jpeg "access plus 6 months"
  ExpiresByType image/gif "access plus 6 months"
  ExpiresByType image/png "access plus 6 months"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>

# GZIP Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json
</IfModule>
