# PMS: send every request to index.php except built app files.
Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    # Pass the Authorization header through (API keys) on CGI/FastCGI hosts
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    # Private folders and files
    RewriteRule ^(server|storage)(/|$) - [F,L]
    RewriteRule ^(cron\.php|VERSION|\.user\.ini)$ - [F,L]
    # Built front-end files are served directly
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^app/ - [L]
    RewriteRule ^ index.php [QSA,L]
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch "\.(js|css|woff2?|svg|png|jpg|webp)$">
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>
    Header always set X-Content-Type-Options "nosniff"
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
</IfModule>
