From eb63eb28f09183f4a0557fe515e07e2f5037ac82 Mon Sep 17 00:00:00 2001 From: pavithra-hn Date: Wed, 26 Aug 2026 21:48:22 +0530 Subject: [PATCH] fix(redirects): send tools.oxlo.ai traffic to www.oxcode.ai Catch-all 307 to the OxCode site. /api/ is excluded because redirects run before rewrites, so catching it would disable the tool route handler and the streaming proxy to the Python runner. --- app/next.config.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/next.config.ts b/app/next.config.ts index 35a9619..e8eacbc 100644 --- a/app/next.config.ts +++ b/app/next.config.ts @@ -1,5 +1,7 @@ import type { NextConfig } from "next"; +const OXCODE = "https://www.oxcode.ai"; + const nextConfig: NextConfig = { reactCompiler: true, // Proxy tier2 streaming tool requests directly to the Python runner, @@ -13,6 +15,15 @@ const nextConfig: NextConfig = { }, ]; }, + async redirects() { + return [ + // Root needs its own rule: the catch-all param below cannot match an empty path. + { source: "/", destination: OXCODE, permanent: false }, + // api/ is excluded because redirects run before rewrites — catching it + // would disable the tool route handler and the streaming proxy above. + { source: "/:path((?!api/).*)", destination: OXCODE, permanent: false }, + ]; + }, }; export default nextConfig;