From 7f2ce962356568a40f136a965b7187836b7e2ce3 Mon Sep 17 00:00:00 2001 From: SakshiKekre Date: Wed, 29 Apr 2026 00:03:23 -0700 Subject: [PATCH 1/3] Add UK chat app rewrite --- vercel.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vercel.json b/vercel.json index 518c417ec..38614a759 100644 --- a/vercel.json +++ b/vercel.json @@ -114,6 +114,14 @@ "source": "/us/taxsim/:path*", "destination": "https://policyengine-taxsim-policy-engine.vercel.app/us/taxsim/:path*" }, + { + "source": "/uk/chat", + "destination": "https://policyengine-uk-chat.vercel.app" + }, + { + "source": "/uk/chat/:path*", + "destination": "https://policyengine-uk-chat.vercel.app/:path*" + }, { "source": "/:countryId/model", "destination": "https://policyengine-model-phi.vercel.app/?country=:countryId" From 3edcdf1af8d0c03118912eaa6b1d53f7beaf03a2 Mon Sep 17 00:00:00 2001 From: SakshiKekre Date: Wed, 29 Apr 2026 10:03:51 -0700 Subject: [PATCH 2/3] Move UK chat rewrite to website config --- vercel.json | 8 -------- website/next.config.ts | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/vercel.json b/vercel.json index 38614a759..518c417ec 100644 --- a/vercel.json +++ b/vercel.json @@ -114,14 +114,6 @@ "source": "/us/taxsim/:path*", "destination": "https://policyengine-taxsim-policy-engine.vercel.app/us/taxsim/:path*" }, - { - "source": "/uk/chat", - "destination": "https://policyengine-uk-chat.vercel.app" - }, - { - "source": "/uk/chat/:path*", - "destination": "https://policyengine-uk-chat.vercel.app/:path*" - }, { "source": "/:countryId/model", "destination": "https://policyengine-model-phi.vercel.app/?country=:countryId" diff --git a/website/next.config.ts b/website/next.config.ts index 73d956e2f..c8d534f54 100644 --- a/website/next.config.ts +++ b/website/next.config.ts @@ -53,6 +53,9 @@ const nextConfig: NextConfig = { { source: "/us/marriage/:path*", destination: "https://marriage-zeta-beryl.vercel.app/us/marriage/:path*" }, { source: "/uk/marriage", destination: "https://marriage-zeta-beryl.vercel.app/us/marriage?country=uk" }, { source: "/uk/marriage/:path*", destination: "https://marriage-zeta-beryl.vercel.app/us/marriage/:path*?country=uk" }, + // UK chat assistant (Vercel) + { source: "/uk/chat", destination: "https://policyengine-uk-chat.vercel.app" }, + { source: "/uk/chat/:path*", destination: "https://policyengine-uk-chat.vercel.app/:path*" }, // Working Parents Tax Relief Act calculator (Vercel) { source: "/us/working-parents-tax-relief-act", destination: "https://wptra.vercel.app/us/working-parents-tax-relief-act" }, { source: "/us/working-parents-tax-relief-act/:path*", destination: "https://wptra.vercel.app/us/working-parents-tax-relief-act/:path*" }, From d618be3a34d43cc9d3dc9d9941d3e172f7c9e44f Mon Sep 17 00:00:00 2001 From: SakshiKekre Date: Wed, 29 Apr 2026 11:25:32 -0700 Subject: [PATCH 3/3] Allow local UK chat origin override --- website/next.config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/next.config.ts b/website/next.config.ts index c8d534f54..fcc654972 100644 --- a/website/next.config.ts +++ b/website/next.config.ts @@ -1,5 +1,9 @@ import type { NextConfig } from "next"; +const ukChatOrigin = ( + process.env.UK_CHAT_ORIGIN ?? "https://policyengine-uk-chat.vercel.app" +).replace(/\/$/, ""); + const nextConfig: NextConfig = { async redirects() { return [ @@ -54,8 +58,8 @@ const nextConfig: NextConfig = { { source: "/uk/marriage", destination: "https://marriage-zeta-beryl.vercel.app/us/marriage?country=uk" }, { source: "/uk/marriage/:path*", destination: "https://marriage-zeta-beryl.vercel.app/us/marriage/:path*?country=uk" }, // UK chat assistant (Vercel) - { source: "/uk/chat", destination: "https://policyengine-uk-chat.vercel.app" }, - { source: "/uk/chat/:path*", destination: "https://policyengine-uk-chat.vercel.app/:path*" }, + { source: "/uk/chat", destination: ukChatOrigin }, + { source: "/uk/chat/:path*", destination: ukChatOrigin + "/:path*" }, // Working Parents Tax Relief Act calculator (Vercel) { source: "/us/working-parents-tax-relief-act", destination: "https://wptra.vercel.app/us/working-parents-tax-relief-act" }, { source: "/us/working-parents-tax-relief-act/:path*", destination: "https://wptra.vercel.app/us/working-parents-tax-relief-act/:path*" },