diff --git a/app/admin/layout.tsx b/app/admin/layout.tsx
index 693f0289..a9b759fc 100644
--- a/app/admin/layout.tsx
+++ b/app/admin/layout.tsx
@@ -31,7 +31,7 @@ import { useThemeStore } from '@/stores/theme-store';
import { getActiveAccountSlotHeaders } from '@/lib/auth/active-account-slot';
import { useUpdateStore, selectHasUpdate } from '@/stores/update-store';
-import { apiFetch } from '@/lib/browser-navigation';
+import { apiFetch, getPathPrefix } from '@/lib/browser-navigation';
// Single-page tab navigation: clicks update a Zustand store. The URL stays
// at /admin so React doesn't fire a route transition on every tab switch -
@@ -177,6 +177,12 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
return <>{children}>;
}
+ // /admin lives outside the [locale] tree, so links back to the webmail
+ // apps are bare tags (hard navigation). Next.js only auto-applies
+ // basePath to /router APIs — for these we prepend it manually so
+ // NEXT_PUBLIC_BASE_PATH=/webmail deployments don't redirect to "/".
+ const prefix = getPathPrefix();
+
const navContent = (
<>