From 0a9befbae9c6c843e07ddfe1a95c6f7544685b94 Mon Sep 17 00:00:00 2001 From: Philipp Urbschat Date: Sat, 12 Sep 2026 21:38:13 +0200 Subject: [PATCH] fix(routing): serve root apps (dinos, plants) and fallback assets --- .htaccess | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.htaccess b/.htaccess index 1e4533b..f63cfa3 100644 --- a/.htaccess +++ b/.htaccess @@ -1,5 +1,5 @@ # DATEI: ./.htaccess -Options -Indexes +Options -Indexes +FollowSymLinks RewriteEngine On # Interne PHP- und Template-Verzeichnisse vor direktem Webzugriff sperren @@ -14,17 +14,23 @@ RewriteRule ^(home|philcore)/(app|core|views|src)/ - [F,L] Require all denied -# 1. Dynamische XML/TXT Dateien -> Ab zum SeoController +# 1. Assets aus home/public weiterleiten (falls direkt aufgerufen wie /css/style.css) +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{DOCUMENT_ROOT}/home/public/$1 -f [OR] +RewriteCond %{DOCUMENT_ROOT}/home/public/$1 -d +RewriteRule ^(.*)$ home/public/$1 [L] + +# 2. Dynamische XML/TXT Dateien -> Ab zum SeoController RewriteRule ^sitemap\.xml$ home/public/index.php?url=seo/sitemap [L,QSA] RewriteRule ^robots\.txt$ home/public/index.php?url=seo/robots [L,QSA] -# 2. Domain-Einstieg +# 3. Domain-Einstieg RewriteRule ^$ home/public/index.php [L] -# 3. Echte Assets schützen -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteCond %{REQUEST_URI} !^/home/public/ +# 4. Echte Verzeichnisse/Dateien im Root (dinos, plants, etc.) direkt bedienen +RewriteCond %{REQUEST_FILENAME} -f [OR] +RewriteCond %{REQUEST_FILENAME} -d +RewriteRule ^ - [L] -# 4. Globales Routing +# 5. Globales Routing ans Portfolio RewriteRule ^(.*)$ home/public/index.php?url=$1 [L,QSA] \ No newline at end of file