# Daniel — Front controller + durcissement (racine = public_html, D-17)

Options -Indexes

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Forcer HTTPS (sauf en local : *.test / localhost)
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} !\.test$ [NC]
    RewriteCond %{HTTP_HOST} !^localhost [NC]
    RewriteCond %{HTTP_HOST} !^127\.0\.0\.1 [NC]
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Bloquer l'accès direct aux dossiers privés
    RewriteRule ^(config|src|templates|storage|database|docs|bin)(/|$) - [F]

    # Front controller : tout ce qui n'est pas un fichier/dossier réel -> index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule>

# Interdire le service de fichiers sensibles
<FilesMatch "(\.(sql|log|ini|example|md|dist|lock)$|^\.|composer\.(json|lock))">
    Require all denied
</FilesMatch>

# Cache navigateur basique
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/webp "access plus 1 month"
    ExpiresByType text/html "access plus 0 seconds"
</IfModule>


# 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/mixer/logs/php.error.log"
   php_flag log_errors On
   php_flag display_errors Off
   php_value max_execution_time 1200
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 120M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php82"
   php_value upload_max_filesize 30M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_value error_log "/home/mixer/logs/php.error.log"
   php_flag log_errors On
   php_flag display_errors Off
   php_value max_execution_time 1200
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 120M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php82"
   php_value upload_max_filesize 30M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit