# ═══════════════════════════════════════════════════════════════════════
# Redirige el subdominio a /public/ (Laravel)
# ═══════════════════════════════════════════════════════════════════════

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Permitir Let's Encrypt
    RewriteRule ^\.well-known/ - [L]

    # Si el archivo o carpeta no existe, reenviar a public/
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L,QSA]

    # Raíz también va a public/
    RewriteRule ^$ public/ [L]
</IfModule>

# ─────────────────────────────────────────────────────────────────────────
# Bloquear archivos sensibles
# ─────────────────────────────────────────────────────────────────────────
<FilesMatch "^(\.env|composer\.json|composer\.lock|package\.json|artisan|.gitignore)$">
    Require all denied
</FilesMatch>

# Bloquear acceso directo a directorios sensibles
RedirectMatch 403 ^/(?:vendor|storage|bootstrap|app|config|database|routes|tests|node_modules)/

# 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/evolucionamos/logs/php.error.log"
   php_flag log_errors On
</IfModule>
<IfModule lsapi_module>
   php_value error_log "/home/evolucionamos/logs/php.error.log"
   php_flag log_errors On
</IfModule>
# END cPanel-generated php ini directives, do not edit

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