From 7705297d32a5fad556c5b2d8149ee2340795f200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aron=20Sch=C3=BCler?= Date: Tue, 11 Jun 2024 12:11:32 +0200 Subject: [PATCH] feat: send non-main-site traffic to main site --- src/main.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.tsx b/src/main.tsx index b3d2cf5..73bcba2 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -7,6 +7,11 @@ import { SettingsProvider } from "./provider/SettingsContext.tsx"; import { UserProvider } from "./provider/UserContext.tsx"; import { router } from "./router.tsx"; +// Redirect to main domain for non-development environments +const MAIN_SITE = "app.r10progress.com"; +if (!import.meta.env.DEV && location.host !== MAIN_SITE) { + window.location.href = `https://${MAIN_SITE}${location.pathname}`; +} ReactDOM.createRoot(document.getElementById("root")!).render(