From 2e1eeebfacaa6fa2d5a8d03f229be1e70865f270 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 27 Jun 2026 04:54:00 +0000 Subject: [PATCH] web: fix 500 on /banner by using absolute redirect destination The /banner redirect 500s under the OpenNext/Cloudflare runtime. Its URL parser treats the empty path segment of a root-relative '/?utm_...' destination as the entire string and hands '/?...' to path-to-regexp, which throws "Unexpected MODIFIER" on the bare '?'. Pointing the redirect at the absolute homepage URL routes through the external-URL parsing branch, which splits the path and query correctly. Verified against an OpenNext preview build: /banner now returns 307 to the UTM-tagged homepage instead of 500. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01KR8qT4wbqAZMLjqU2D4JGG --- web/next.config.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/next.config.mjs b/web/next.config.mjs index 5ac5fd0..722a561 100644 --- a/web/next.config.mjs +++ b/web/next.config.mjs @@ -50,10 +50,17 @@ const nextConfig = { // (not permanent) so /banner can be repointed at the next event without // browsers having cached a permanent redirect. Current event: // AI Engineer World's Fair. + // + // The destination is an absolute URL on purpose. A relative root-path + // destination ('/?utm_...') 500s under our OpenNext/Cloudflare runtime: + // its URL parser treats the empty path segment of '/?...' as the whole + // string and feeds '/?...' to path-to-regexp, which throws "Unexpected + // MODIFIER" on the bare '?'. Using the absolute form routes through the + // external-URL branch, which splits the path and query correctly. { source: '/banner', destination: - '/?utm_source=ai-engineer-worldfair&utm_medium=banner&utm_campaign=ai-engineer-worldfair-2026', + 'https://agentrelay.com/?utm_source=ai-engineer-worldfair&utm_medium=banner&utm_campaign=ai-engineer-worldfair-2026', permanent: false, }, { source: '/quickstart', destination: '/docs/quickstart', permanent: true },