# VEOTAP CI4 v1.5.1 — cPanel public_html document root
Options -Indexes -MultiViews
DirectoryIndex index.php
ServerSignature Off

<IfModule mod_rewrite.c>
    RewriteEngine On
    # Fail-closed: no private CI4 source, writable uploads, secrets or vendor reachable.
    RewriteRule ^(?:_veotap_core|app|system|vendor|writable|tests|tools|deploy|docs|public)(?:/|$) - [F,L,NC]
    RewriteRule ^assets/.*\.(?:php[0-9]?|phtml|phar)$ - [F,L,NC]
    RewriteRule ^(?:spark|\.env(?:\..*)?|composer\.(?:json|lock)|phpunit\.dist\.xml|preload\.php|\.git(?:/|$))$ - [F,L,NC]
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L,QSA]
</IfModule>

<FilesMatch "(?i)^(?:\..*|spark|.*\.(?:bak|sql|sqlite|log|ini|phar|zip|tgz|tar|gz)|composer\.(?:json|lock))$">
    Require all denied
</FilesMatch>

# VEOTAP v1.11.0 — public assets only; never cache private endpoints.
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/webp "access plus 7 days"
    ExpiresByType image/png "access plus 7 days"
    ExpiresByType image/svg+xml "access plus 7 days"
    ExpiresByType text/css "access plus 2 days"
    ExpiresByType application/javascript "access plus 2 days"
</IfModule>
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json application/xml image/svg+xml
</IfModule>
