Skip to content

Commit

Permalink
feat: send non-main-site traffic to main site
Browse files Browse the repository at this point in the history
  • Loading branch information
thraizz committed Jun 11, 2024
1 parent c30f4aa commit 14b5eaa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
location.replace(MAIN_SITE + location.pathname);
}
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<UserProvider>
Expand Down

0 comments on commit 14b5eaa

Please sign in to comment.