b26959a041
- Add src/i18n/hreflang-map.ts with getHreflangUrl() for translated slugs - Fix BaseLayout.astro hreflang tags (was hardcoding ES='/', 404 URLs) - Fix LangToggle.astro to use hreflang map instead of naive path swap - Fix htaccess.conf: remove !-f / !-d that blocked .html redirects
70 lines
2.0 KiB
Plaintext
70 lines
2.0 KiB
Plaintext
# Hosting del Sur — .htaccess
|
|
# Generado para el sitio estático Astro
|
|
|
|
<IfModule mod_rewrite.c>
|
|
RewriteEngine On
|
|
|
|
# HTTPS forzado
|
|
RewriteCond %{HTTPS} off
|
|
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
|
|
|
|
# www → no-www
|
|
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
|
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
|
|
|
|
# Quitar .html de la URL — evita duplicados index.html vs /
|
|
RewriteCond %{REQUEST_URI} ^(.+)\.html$ [NC]
|
|
RewriteRule ^(.+)\.html$ /$1 [R=301,L]
|
|
</IfModule>
|
|
|
|
# Compresión gzip
|
|
<IfModule mod_deflate.c>
|
|
AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json image/svg+xml application/xml font/woff2
|
|
</IfModule>
|
|
|
|
# Cache-control
|
|
<IfModule mod_expires.c>
|
|
ExpiresActive On
|
|
ExpiresByType image/avif "access plus 1 year"
|
|
ExpiresByType image/webp "access plus 1 year"
|
|
ExpiresByType image/svg+xml "access plus 1 year"
|
|
ExpiresByType image/jpeg "access plus 1 year"
|
|
ExpiresByType image/png "access plus 1 year"
|
|
ExpiresByType text/css "access plus 1 year"
|
|
ExpiresByType application/javascript "access plus 1 year"
|
|
ExpiresByType font/woff2 "access plus 1 year"
|
|
ExpiresByType text/html "access plus 1 hour"
|
|
</IfModule>
|
|
|
|
# Security headers
|
|
<IfModule mod_headers.c>
|
|
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=()"
|
|
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains" env=HTTPS
|
|
</IfModule>
|
|
|
|
# Proteger archivos sensibles
|
|
<FilesMatch "^\.htaccess$">
|
|
Require all denied
|
|
</FilesMatch>
|
|
|
|
<FilesMatch "\.(env|json|lock|md|yaml|yml)$">
|
|
Require all denied
|
|
</FilesMatch>
|
|
|
|
# No listado de directorios
|
|
Options -Indexes +Includes
|
|
|
|
# Páginas de error custom
|
|
ErrorDocument 404 /404.shtml
|
|
ErrorDocument 500 /500.shtml
|
|
|
|
# Habilitar SSI para .shtml (cPanel lo desactiva por default)
|
|
AddType text/html .shtml
|
|
AddHandler server-parsed .shtml
|
|
<IfModule mod_include.c>
|
|
Options +Includes
|
|
</IfModule>
|