RewriteEngine On

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !\.localhost$ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule ^en(/.*)?$ index.html [L]
RewriteRule ^ua(/.*)?$ index.html [L]

<IfModule mod_headers.c>
    <FilesMatch "\.html$">
        Header set Cache-Control "no-cache, must-revalidate"
    </FilesMatch>

    <FilesMatch "\.(js|css|json)$">
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>

    <Files "sw.js">
        Header set Cache-Control "no-cache, must-revalidate"
    </Files>
</IfModule>
