RewriteEngine On
RewriteBase /sits/public/

# Block direct access to sensitive folders if mis-copied into public
RewriteCond %{REQUEST_URI} ^/(config|core|app|database|routes)/ [NC]
RewriteRule ^ - [F,L]

# Route everything else through the front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]

# Security headers
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set X-Frame-Options "SAMEORIGIN"
  Header set X-XSS-Protection "1; mode=block"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# If your host runs classic mod_php (not PHP-FPM) and uploads over ~2-8MB still fail
# even after this app's own checks pass, uncomment these two lines:
# php_value upload_max_filesize 12M
# php_value post_max_size 15M
