From b510558b5ebc07db30342869651c93f84d7b90d8 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sun, 15 Feb 2026 14:30:47 -0700 Subject: [PATCH] fix: redirect /board/* from jeffemmett.com to canvas.jeffemmett.com When visiting jeffemmett.com/board/mycofi, the redirect now correctly goes to canvas.jeffemmett.com/mycofi/ instead of jeffemmett.com/mycofi. Localhost and canvas.jeffemmett.com still use same-domain redirects. Co-Authored-By: Claude Opus 4.6 --- src/App.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 2a60a0e..fb33685 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -89,10 +89,18 @@ const OptionalAuthRoute = ({ children }: { children: React.ReactNode }) => { /** * Component to redirect /board/:slug URLs to clean /:slug/ URLs - * Used on staging to support both old and new URL patterns + * On non-canvas hostnames (e.g. jeffemmett.com), redirects to canvas.jeffemmett.com/:slug/ + * On canvas.jeffemmett.com, does a same-domain redirect to /:slug/ */ const RedirectBoardSlug = () => { const { slug } = useParams<{ slug: string }>(); + const canvasHost = 'canvas.jeffemmett.com'; + + if (window.location.hostname !== canvasHost && window.location.hostname !== 'localhost') { + window.location.replace(`https://${canvasHost}/${slug}/`); + return null; + } + return ; };