
# Scanzaa security hardening
Options -Indexes
<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 Permissions-Policy "camera=(), microphone=(), geolocation=()"
</IfModule>

<FilesMatch "(^\.|\.(sql|log|bak|old|ini|env|dist)$|composer\.(json|lock)$|SECURE_ENVIRONMENT)">
  Require all denied
</FilesMatch>
<FilesMatch "^(conf|db\.class|auth|send_emails)\.php$">
  Require all denied
</FilesMatch>
<IfModule mod_headers.c>
  <FilesMatch "\.php$">
    Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
    Header set Pragma "no-cache"
  </FilesMatch>
</IfModule>

RewriteEngine On

# 0) Redirect bare domain to index.html (change R=302 to R=301 after testing)
RewriteCond %{REQUEST_URI} ^/?$ 
RewriteCond %{DOCUMENT_ROOT}/index.html -f
RewriteRule ^$ /index.html [R=302,L]

# 1) Don’t rewrite requests under /admin/, /images/, or /services/ (recursively)
RewriteCond %{REQUEST_URI} ^/?(admin|images|services)/ [NC]
RewriteRule ^ - [L]

# 2) Don’t rewrite if the file or directory exists
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# 3) Otherwise rewrite to index.php
RewriteRule ^(.+)$ index.php?code=$1 [L,QSA]

# 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_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 128M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php84"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 128M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php84"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

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