# Centro de Idiomas · API PHP
Options -Indexes
DirectoryIndex index.php

# Solo index.php es accesible: config.php, src/, sql/ y datos/ quedan protegidos.
<IfModule mod_authz_core.c>
  <FilesMatch "\.(php|json|sql|ini|txt|md|log|bak)$|^\.">
    Require all denied
  </FilesMatch>
  <Files "index.php">
    Require all granted
  </Files>
</IfModule>

# Con mod_rewrite también se aceptan rutas limpias: /api/matriculas → index.php?r=matriculas
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?r=$1 [QSA,L]
</IfModule>

# Límites para respaldos y archivos subidos (si PHP funciona como módulo de Apache).
<IfModule mod_php.c>
  php_value upload_max_filesize 8M
  php_value post_max_size 64M
  php_value memory_limit 256M
  php_value max_execution_time 120
  php_flag display_errors Off
</IfModule>
