# Christmas Crunch Match - Apache / cPanel configuration

Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Block source, config, tooling and VCS folders from the web.
    RewriteRule ^(app|database|storage|tools|tests|resources|node_modules|vendor)(/|$) - [F,L,NC]

    # Block dotfiles (.env, .git, ...) and build/meta files.
    RewriteRule (^|/)\. - [F,L]
    RewriteRule ^(package(-lock)?\.json|tailwind\.config\.js|composer\.(json|lock)|README\.md)$ - [F,L,NC]
</IfModule>

# Fallback when mod_rewrite is unavailable.
<FilesMatch "^(\.|package(-lock)?\.json$|tailwind\.config\.js$|composer\.(json|lock)$)">
    Require all denied
</FilesMatch>

<IfModule mod_headers.c>
    # setifempty: PHP responses already send these (App\Core\Response); static files get them here.
    Header setifempty X-Content-Type-Options "nosniff"
    Header setifempty Referrer-Policy "strict-origin-when-cross-origin"
    Header setifempty X-Frame-Options "DENY"
    # Uncomment once the site is served over HTTPS only:
    # Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
</IfModule>

# Long-lived caching for versioned static assets (?v= cache busting).
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

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

AddType font/woff2 .woff2
