# C-PDF Lab — configuración para servidores Apache (la mayoría de hostings compartidos)
Options -Indexes

# Tipos de archivo de las descargas
AddType application/vnd.microsoft.portable-executable .exe
AddType application/zip .zip
AddType application/json .json
AddType font/woff2 .woff2
AddType image/svg+xml .svg
AddCharset utf-8 .html .css .js .json .txt .xml

<FilesMatch "\.(exe|zip)$">
  Header set Content-Disposition attachment
</FilesMatch>

# Caché: recursos estáticos un mes; la página y los datos de versión siempre frescos
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 hour"
  ExpiresByType font/woff2 "access plus 1 year"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/svg+xml "access plus 1 month"
  ExpiresByType text/html "access plus 0 seconds"
  ExpiresByType application/json "access plus 0 seconds"
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml text/plain
</IfModule>

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# Forzar HTTPS (descomentar cuando el certificado SSL esté activo)
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
