ErrorDocument 404 /404.html
Options -Indexes

# Force .html files to be interpreted as .shtml (SSI includes)
Options +Includes
XBitHack on
AddHandler server-parsed .html

<FilesMatch "\.(js|css|html|htm)$">
SetOutputFilter DEFLATE
</FilesMatch>

RewriteEngine On

# Choouse root page - the same is performed by JavaScript
RewriteRule ^$ https://%{HTTP_HOST}/ru/ [R=301,L]

# Removing "www." prefix
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ http://day8.info/$1 [R=301,L]

# Force HTTPS Redirect
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# END HTTPS Redirect

# We use SSI even for .html, and all pages are dynamic; so it makes sense to reduce requests
ExpiresActive On
ExpiresByType image/gif A3600
ExpiresByType image/jpeg A3600
ExpiresByType text/html A600
ExpiresByType application/javascript A3600
ExpiresByType application/x-javascript A3600
