feat(404): página custom con SSI de cPanel + htaccess con Options +Includes
- 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
This commit is contained in:
@@ -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' \
|
||||
|
||||
+12
-1
@@ -57,4 +57,15 @@
|
||||
</FilesMatch>
|
||||
|
||||
# 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
|
||||
<IfModule mod_include.c>
|
||||
Options +Includes
|
||||
</IfModule>
|
||||
|
||||
Reference in New Issue
Block a user