SSR switch-on fix: proxy the DirectoryIndex homepage detour

First switch-on with a running node: Apache mod_dir turns / into /index.html via the DirectoryIndex subrequest before the per-dir root rule can proxy it; the node then asked for /_json/index.html and rendered a cacheable 404 homepage. New flag-gated rule proxies index.html as / to the node. Companion fix outside git: public/_frontend/.htaccess (build output, gitignored) overrides the root rewrites for /_frontend/*, so release assets only existing on the VPS were answered by its SPA fallback with index.html - HTML served as JS; the flag-gated asset proxy now also sits in that file before the fallback, and the frontend build must adopt it in its .htaccess template (ticket 0059-BE).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
orascheandClaude Fable 5 committed 2026-11-09 20:20:07 +01:00
1 parent d153cc2eba
commit d52d49974f
2 files changed
+14

No files matched your search

+6
View File
@@ -356,6 +356,12 @@ AddDefaultCharset utf-8
# Emergency off without TYPO3: delete the flag file. # Emergency off without TYPO3: delete the flag file.
RewriteCond /usr/www/users/vitecevo/live/var/vitec-ssr-on.flag -f RewriteCond /usr/www/users/vitecevo/live/var/vitec-ssr-on.flag -f
RewriteRule ^$ https://vitec-ssr.evomedien.de/ [P,L,E=SSRPROXY:1] RewriteRule ^$ https://vitec-ssr.evomedien.de/ [P,L,E=SSRPROXY:1]
# mod_dir turns "/" into "/index.html" via DirectoryIndex subrequest
# before the rule above can proxy it (found 2026-11-09 evening: the
# SSR node logged GET /index.html -> /_json/index.html -> 404).
# Catch that spelling and send it to the node as the homepage:
RewriteCond /usr/www/users/vitecevo/live/var/vitec-ssr-on.flag -f
RewriteRule ^index\.html$ https://vitec-ssr.evomedien.de/ [P,L,E=SSRPROXY:1]
# Flag ON: the hashed JS/CSS files come from the VPS release too # Flag ON: the hashed JS/CSS files come from the VPS release too
# (0054-FE 5.1 / 0055-BE question 1). No !-f guard on purpose: a # (0054-FE 5.1 / 0055-BE question 1). No !-f guard on purpose: a
# same-named file from an older local SPA build must not win, the # same-named file from an older local SPA build must not win, the
+8
View File
@@ -3,6 +3,14 @@ RewriteBase /_frontend/
RewriteRule ^index\.html$ - [L] RewriteRule ^index\.html$ - [L]
# SSR flag ON: hashed assets are served from the VPS release - its hashes
# must win over any local build, and the fallback below must never answer
# an asset request with index.html (the browser would get HTML as JS).
# This directory's .htaccess overrides the root one for /_frontend/*, so
# the rule has to live HERE, not in public/.htaccess (2026-11-09).
RewriteCond /usr/www/users/vitecevo/live/var/vitec-ssr-on.flag -f
RewriteRule ^assets/(.*)$ https://vitec-ssr.evomedien.de/_frontend/assets/$1 [P,L]
RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L] RewriteRule ^ - [L]