# Archivos subidos por clientes: nunca se ejecutan
<FilesMatch "\.(?i:php\d?|phtml|phar|pl|py|cgi|sh|html?|svg|js|htaccess)$">
  Require all denied
</FilesMatch>
Options -Indexes -ExecCGI
RemoveHandler .php .phtml .php3 .php4 .php5 .php7 .php8 .phar
RemoveType .php .phtml .phar
<IfModule mod_php.c>
  php_flag engine off
</IfModule>

<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  # Descargables: PDF en modo aislado; Office siempre como descarga
  <FilesMatch "\.pdf$">
    Header set Content-Security-Policy "sandbox"
  </FilesMatch>
  <FilesMatch "\.(docx?|xlsx?|pptx?|txt)$">
    Header set Content-Disposition "attachment"
  </FilesMatch>
</IfModule>
