# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php8_module>
   php_value error_log "/home/farouktest/logs/php.error.log"
   php_flag log_errors On
</IfModule>
<IfModule lsapi_module>
   php_value error_log "/home/farouktest/logs/php.error.log"
   php_flag log_errors On
</IfModule>
# END cPanel-generated php ini directives, do not edit

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteOptions IgnoreInherit
    CGIPassAuth On

    RewriteCond %{HTTPS} !=on
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteRule ^(?:\.env(?:\..*)?|composer\.(?:json|lock)|bin(?:/|$)|vendor(?:/|$)|src(?:/|$)|config(?:/|$)|database(?:/|$)|docs(?:/|$)|tests(?:/|$)|logs(?:/|$)|storage(?:/|$)|error_log|\.phpunit\.cache(?:/|$)|artifacts(?:/|$)|vuexy-admin[^/]*(?:/|$)|tools(?:/|$)) - [F,L]

    # Public marketing homepage serves index.html at /
    # Friendly login entry points redirect to existing portal login pages so relative assets resolve.
    RewriteRule ^login/?$ /login/index.html [L]
    RewriteRule ^login/admin/?$ /dashboard/login.html [R=302,L]
    RewriteRule ^login/institution/?$ /institution/login.html [R=302,L]
    RewriteRule ^login/parent/?$ /parent/login.html [R=302,L]

    RewriteRule ^api(?:/.*)?$ public/index.php [END,QSA]
    RewriteRule ^payment/([a-f0-9]{64})$ payment/index.html [END]
</IfModule>

# Application-level security headers for static HTML/assets (Apache serves these
# outside Slim). Keep in sync with App\Middleware\SecurityHeadersMiddleware.
# Enforcing CSP is NOT enabled here: portals use inline scripts + Google Fonts.
<IfModule mod_headers.c>
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
    Header always set X-Permitted-Cross-Domain-Policies "none"
    Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
    Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
</IfModule>

# Compress and cache static assets. Version query strings bust CSS/JS when they change.
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json image/svg+xml
</IfModule>
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 7 days"
    ExpiresByType application/javascript "access plus 7 days"
    ExpiresByType text/javascript "access plus 7 days"
    ExpiresByType image/svg+xml "access plus 7 days"
    ExpiresByType font/woff2 "access plus 30 days"
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php82 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
