fix: use internal redirect for /board/:slug on staging
Changed RedirectBoardSlug to use React Router's Navigate instead of window.location.href to a non-existent domain. Now /board/:slug redirects to /:slug/ within the same domain. Production (main branch) keeps /board/:slug unchanged. Staging (dev branch) supports both /board/:slug and /:slug patterns. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
53d3620cff
commit
4974c0e303
15
src/App.tsx
15
src/App.tsx
|
|
@ -112,21 +112,12 @@ const OptionalAuthRoute = ({ children }: { children: React.ReactNode }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to redirect old /board/:slug URLs to canvas.jeffemmett.com/:slug/
|
* Component to redirect /board/:slug URLs to clean /:slug/ URLs
|
||||||
* This handles legacy URLs from jeffemmett.com/board/*
|
* Used on staging to support both old and new URL patterns
|
||||||
*/
|
*/
|
||||||
const RedirectBoardSlug = () => {
|
const RedirectBoardSlug = () => {
|
||||||
const { slug } = useParams<{ slug: string }>();
|
const { slug } = useParams<{ slug: string }>();
|
||||||
|
return <Navigate to={`/${slug}/`} replace />;
|
||||||
// Redirect to canvas.jeffemmett.com for the canonical board URL
|
|
||||||
useEffect(() => {
|
|
||||||
if (slug) {
|
|
||||||
window.location.href = `https://canvas.jeffemmett.com/${slug}/`;
|
|
||||||
}
|
|
||||||
}, [slug]);
|
|
||||||
|
|
||||||
// Show loading while redirecting
|
|
||||||
return <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}>Redirecting to canvas...</div>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue