|
1 | | - |
2 | 1 | import { Toaster } from "@/components/ui/toaster"; |
3 | 2 | import { Toaster as Sonner } from "@/components/ui/sonner"; |
4 | 3 | import { TooltipProvider } from "@/components/ui/tooltip"; |
@@ -54,30 +53,25 @@ const DomainRouter = () => { |
54 | 53 | const hostname = window.location.hostname; |
55 | 54 | const currentPath = window.location.pathname; |
56 | 55 |
|
57 | | - // Redirection basée sur le domaine, mais on évite de rediriger les routes fonctionnelles |
58 | | - if (hostname === 'refspring.com' && currentPath === '/') { |
59 | | - window.location.replace('/landing'); |
60 | | - } else if (hostname === 'dashboard.refspring.com' && currentPath === '/') { |
| 56 | + // Redirection simple basée sur le domaine |
| 57 | + if (hostname === 'dashboard.refspring.com' && currentPath === '/') { |
61 | 58 | window.location.replace('/dashboard'); |
62 | | - } else if (hostname === 'refspring.com' && currentPath === '/dashboard') { |
63 | | - window.location.replace('/landing'); |
64 | 59 | } |
65 | 60 | }, []); |
66 | 61 |
|
67 | 62 | return ( |
68 | 63 | <ErrorBoundary> |
69 | 64 | <Suspense fallback={<PageSkeleton />}> |
70 | 65 | <Routes> |
71 | | - {/* Route principale - comportement par défaut selon le domaine */} |
| 66 | + {/* Route principale - Landing page sur refspring.com, Dashboard sur dashboard.refspring.com */} |
72 | 67 | <Route path="/" element={ |
73 | 68 | window.location.hostname === 'dashboard.refspring.com' |
74 | 69 | ? <Navigate to="/dashboard" replace /> |
75 | | - : <Navigate to="/landing" replace /> |
| 70 | + : <LandingPage /> |
76 | 71 | } /> |
77 | 72 |
|
78 | | - {/* Pages principales */} |
| 73 | + {/* Dashboard accessible uniquement via /dashboard */} |
79 | 74 | <Route path="/dashboard" element={<Index />} /> |
80 | | - <Route path="/landing" element={<LandingPage />} /> |
81 | 75 | <Route path="/advanced-stats" element={<AdvancedStatsPage />} /> |
82 | 76 | <Route path="/advanced-stats/:campaignId" element={<AdvancedStatsPage />} /> |
83 | 77 |
|
|
0 commit comments