Options -Indexes
Options -MultiViews

# PHP ocultar errores en producci¨Žn
php_flag  display_errors  Off
php_value error_reporting 0

# Headers de seguridad
<IfModule mod_headers.c>
  Header always set X-Frame-Options         "SAMEORIGIN"
  Header always set X-Content-Type-Options  "nosniff"
  Header always set X-XSS-Protection        "1; mode=block"
  Header always set Referrer-Policy         "strict-origin-when-cross-origin"
  Header always set Permissions-Policy      "geolocation=(), microphone=()"
</IfModule>

# Proteger carpetas sensibles
<FilesMatch "\.(env|sql|log|sh|git)$">
  Order Allow,Deny
  Deny from all
</FilesMatch>

# Cache para assets est¨˘ticos
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css              "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType image/png             "access plus 6 months"
  ExpiresByType image/jpeg            "access plus 6 months"
  ExpiresByType image/webp            "access plus 6 months"
  ExpiresByType image/svg+xml        "access plus 1 month"
</IfModule>

# Comprimir respuestas
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css
  AddOutputFilterByType DEFLATE application/javascript application/json
</IfModule>

# Bloquear acceso directo a app/
RewriteEngine On
RewriteRule ^app/         - [F,L]
RewriteRule ^uploads/.*\.php$ - [F,L]