From 8591d93b8803b5a78527a98f2a3e4079c82dba3f Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sat, 4 Jul 2026 04:45:24 +0900 Subject: [PATCH] fix: ensure MapRazorPages routes Sitemap before SPA fallback Order is critical: 1. UseBlazorFrameworkFiles (middleware) 2. MapControllers/MapFastEndpoints (specific routes) 3. MapRazorPages (Sitemap.cshtml matches here) 4. MapFallbackToFile (catch-all last) This prevents /taxbaik/sitemap.xml from being caught by admin fallback. Co-Authored-By: Claude Haiku 4.5 --- src/TaxBaik.Web/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TaxBaik.Web/Program.cs b/src/TaxBaik.Web/Program.cs index 7fef3ae..e866418 100644 --- a/src/TaxBaik.Web/Program.cs +++ b/src/TaxBaik.Web/Program.cs @@ -388,10 +388,10 @@ app.UseStaticFiles("/portal"); app.MapControllers(); app.MapFastEndpoints(); app.MapHealthChecks("/healthz"); -app.MapRazorPages(); +app.MapRazorPages(); // Sitemap.cshtml이 여기서 먼저 매치됨! app.MapStaticAssets(); -// SPA 라우팅 폴백 (각 경로에서 index.html 제공) +// SPA 라우팅 폴백 (각 경로에서 index.html 제공) - 가장 마지막에! app.MapFallbackToFile("admin/{*path:nonfile}", "admin/index.html"); app.MapFallbackToFile("portal/{*path:nonfile}", "portal/index.html");