Options -Indexes
DirectoryIndex index.html

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Clean Share URL: /share/ID or /s/ID rewrites internally to share.php?id=ID
  RewriteRule ^share/([A-Za-z0-9_-]+)/?$ share.php?id=$1 [L,QSA]
  RewriteRule ^s/([A-Za-z0-9_-]+)/?$ share.php?id=$1 [L,QSA]

  # Don't rewrite existing files or directories or API
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # SPA Routing for client-side routing
  RewriteRule ^ index.html [L]
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\.(html)$">
    Header set Cache-Control "no-cache, no-store, must-revalidate"
  </FilesMatch>
  <FilesMatch "\.(js|css|svg|png|jpg|jpeg|webp|woff2|mp4)$">
    Header set Cache-Control "public, max-age=604800"
  </FilesMatch>
</IfModule>

<IfModule mod_mime.c>
  AddType video/mp4 .mp4
</IfModule>
