From 03bb437e094e84492d22a9568b3cfd640f094eb9 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 15 Aug 2025 13:07:54 -0700 Subject: [PATCH] fix(chat-deploy): fixed chat-deploy (#981) --- apps/sim/middleware.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/sim/middleware.ts b/apps/sim/middleware.ts index 80285b6d14..303eb86a2e 100644 --- a/apps/sim/middleware.ts +++ b/apps/sim/middleware.ts @@ -73,7 +73,8 @@ export async function middleware(request: NextRequest) { } // For self-hosted deployments, redirect root path based on session status - if (!isHosted && url.pathname === '/') { + // Only apply redirects to the main domain, not subdomains + if (!isHosted && !isCustomDomain && url.pathname === '/') { if (hasActiveSession) { // User has active session, redirect to workspace return NextResponse.redirect(new URL('/workspace', request.url))