'text/css; charset=utf-8', 'html' => 'text/html; charset=utf-8', 'js' => 'text/javascript; charset=utf-8', 'json' => 'application/json; charset=utf-8', 'svg' => 'image/svg+xml', ]; header('Content-Type: ' . ($contentTypes[$extension] ?? 'application/octet-stream')); readfile($file); return true; } http_response_code(404); header('Content-Type: text/plain; charset=utf-8'); echo "Not found\n";