# ============================================================
# Desarrollo web & IA — configuración de servidor (Hostinger/Apache)
# ============================================================
# --- Página de inicio ---
DirectoryIndex index.html
# --- Forzar HTTPS (descomenta cuando tengas el dominio + SSL activo) ---
#
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
#
# --- Compresión GZIP ---
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript application/json image/svg+xml application/xml
# --- Caché del navegador ---
ExpiresActive On
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
# --- Cabeceras de seguridad básicas ---
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set Referrer-Policy "strict-origin-when-cross-origin"
Header set Permissions-Policy "geolocation=(), microphone=(), camera=()"
# No cachear el HTML (para que los cambios se vean tras subir)
Header set Cache-Control "no-cache, must-revalidate"
# --- Tipos MIME por si el servidor no los reconoce ---
AddType image/svg+xml .svg
AddType application/manifest+json .webmanifest
# --- Página de error: vuelve al inicio ---
ErrorDocument 404 /index.html