Skip to content

Commit 84a01d1

Browse files
Fix: Landing page URL
Redirect root path to landing page to use the root URL.
1 parent 409fabe commit 84a01d1

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

src/App.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Toaster } from "@/components/ui/toaster";
32
import { Toaster as Sonner } from "@/components/ui/sonner";
43
import { TooltipProvider } from "@/components/ui/tooltip";
@@ -54,30 +53,25 @@ const DomainRouter = () => {
5453
const hostname = window.location.hostname;
5554
const currentPath = window.location.pathname;
5655

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 === '/') {
6158
window.location.replace('/dashboard');
62-
} else if (hostname === 'refspring.com' && currentPath === '/dashboard') {
63-
window.location.replace('/landing');
6459
}
6560
}, []);
6661

6762
return (
6863
<ErrorBoundary>
6964
<Suspense fallback={<PageSkeleton />}>
7065
<Routes>
71-
{/* Route principale - comportement par défaut selon le domaine */}
66+
{/* Route principale - Landing page sur refspring.com, Dashboard sur dashboard.refspring.com */}
7267
<Route path="/" element={
7368
window.location.hostname === 'dashboard.refspring.com'
7469
? <Navigate to="/dashboard" replace />
75-
: <Navigate to="/landing" replace />
70+
: <LandingPage />
7671
} />
7772

78-
{/* Pages principales */}
73+
{/* Dashboard accessible uniquement via /dashboard */}
7974
<Route path="/dashboard" element={<Index />} />
80-
<Route path="/landing" element={<LandingPage />} />
8175
<Route path="/advanced-stats" element={<AdvancedStatsPage />} />
8276
<Route path="/advanced-stats/:campaignId" element={<AdvancedStatsPage />} />
8377

0 commit comments

Comments
 (0)