# ---- PHP version (cPanel MultiPHP). Use ea-php83 if ea-php84 is not offered on your server. ----
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php84 .php .php7 .phtml
</IfModule>

Options -Indexes
DirectoryIndex index.php

# ---- Force HTTPS ----
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ---- Never serve internal files ----
<FilesMatch "(?i)\.(sql|log|inc|bak|old|orig|docx|csv|md|sample\.php)$|^config\.php$|^error_log$|^\.">
  Require all denied
</FilesMatch>

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Strict-Transport-Security "max-age=31536000"
</IfModule>
