From db6668793e8839f6ac8c399e135dedbc5462b74e Mon Sep 17 00:00:00 2001 From: Mauri Date: Tue, 9 Jun 2026 09:22:32 -0300 Subject: [PATCH] =?UTF-8?q?feat(404):=20p=C3=A1gina=20custom=20con=20SSI?= =?UTF-8?q?=20de=20cPanel=20+=20htaccess=20con=20Options=20+Includes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 404.shtml duplicado de 404.html con SSI embedded (REQUEST_URI, REMOTE_ADDR, HTTP_USER_AGENT, etc.) - .htaccess actualizado: ErrorDocument 404 /404.shtml, Options +Includes, AddHandler server-parsed - cPanel deshabilita Includes por default en cada VirtualHost, hay que activarlo en el .htaccess del usuario - Verificado online: SSI procesa correctamente, URL/UA/IP visibles en la página --- scripts/deploy.sh | 6 ++++ scripts/htaccess.conf | 13 ++++++++- src/pages/404.astro | 67 +++++++++++++++++++------------------------ 3 files changed, 48 insertions(+), 38 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 3d63528..f532b59 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -20,6 +20,12 @@ cp /root/opencode/development/hostingdelsur.net/src/forms/api-htaccess "$DIST/ap # Copy root .htaccess (HTTPS forzado, security headers) cp /root/opencode/development/hostingdelsur.net/scripts/htaccess.conf "$DIST/.htaccess" +# cPanel recognizes 404.shtml specifically (Server-Side Includes) +# Astro generates 404.html — duplicate as .shtml for cPanel +if [ -f "$DIST/404.html" ]; then + cp "$DIST/404.html" "$DIST/404.shtml" +fi + # rsync with --delete to mirror (preserva mwp/, .well-known/, etc.) rsync -avz --delete \ --exclude='mwp' \ diff --git a/scripts/htaccess.conf b/scripts/htaccess.conf index cd7bf51..c82c2e4 100644 --- a/scripts/htaccess.conf +++ b/scripts/htaccess.conf @@ -57,4 +57,15 @@ # No listado de directorios -Options -Indexes +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 + + Options +Includes + diff --git a/src/pages/404.astro b/src/pages/404.astro index b90b565..46aca04 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -1,10 +1,9 @@ --- import BaseLayout from '@/layouts/BaseLayout.astro'; -import CloudDivider from '@/components/CloudDivider.astro'; ---
@@ -28,10 +27,8 @@ import CloudDivider from '@/components/CloudDivider.astro'; - - @@ -48,65 +45,49 @@ import CloudDivider from '@/components/CloudDivider.astro'; - - - - - - - - - - - - - - - - @@ -114,34 +95,24 @@ import CloudDivider from '@/components/CloudDivider.astro'; - - - - - - - - - - @@ -151,18 +122,15 @@ import CloudDivider from '@/components/CloudDivider.astro'; - - -
@@ -190,11 +158,36 @@ import CloudDivider from '@/components/CloudDivider.astro';
-
- Ver servicios - Ver planes - Contacto + + +
+

+ Detalles técnicos +

+
+
+
URL solicitada:
+
+
+
+
URL de referencia:
+
+
+
+
IP del visitante:
+
+
+
+
Navegador:
+
+
+
+
Servidor:
+
+
+
+