<IfModule mod_rewrite.c>
RewriteEngine On
# Force HTTPS redirect
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect non-existent paths to homepage
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ / [R=301,L]
# Redirect existing but empty directories to homepage
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.shtml !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^.*$ / [R=301,L]
</IfModule>
<filesMatch "\.(html|shtml)$">
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</filesMatch>