diff --git a/app/router.php b/app/router.php index 73220a6..91b6d75 100644 --- a/app/router.php +++ b/app/router.php @@ -359,6 +359,18 @@ if (file_exists($assetPath) && is_file($assetPath)) { exit; } +// Check for static files in content directory +$contentFilePath = rtrim($contentDir, '/') . '/' . ltrim($requestPath, '/'); +if (file_exists($contentFilePath) && is_file($contentFilePath)) { + $ext = pathinfo($contentFilePath, PATHINFO_EXTENSION); + // Only serve non-PHP/non-HTML/non-MD files as static assets + if (!in_array($ext, ['php', 'html', 'md'])) { + header('Content-Type: ' . (mime_content_type($contentFilePath) ?: 'application/octet-stream')); + readfile($contentFilePath); + exit; + } +} + // Handle frontpage if (empty($requestPath)) { // Try language-specific frontpage first, then default