diff --git a/client/pages/SubdomainPassport.tsx b/client/pages/SubdomainPassport.tsx index 2c833932..b7d4d495 100644 --- a/client/pages/SubdomainPassport.tsx +++ b/client/pages/SubdomainPassport.tsx @@ -10,14 +10,8 @@ import FourOhFourPage from "@/pages/404"; import Index from "@/pages/Index"; import type { AethexUserProfile } from "@/lib/aethex-database-adapter"; -const getApiBase = () => { - if (typeof window === "undefined") return ""; - const hostname = window.location.hostname; - if (hostname.includes("aethex.me") || hostname.includes("aethex.space")) { - return "https://aethex.dev"; - } - return window.location.origin; -}; +const getApiBase = () => + typeof window !== "undefined" ? window.location.origin : ""; interface CreatorPassportResponse { type: "creator"; diff --git a/vercel.json b/vercel.json index 33c8d11d..852fa18c 100644 --- a/vercel.json +++ b/vercel.json @@ -53,6 +53,20 @@ } ], "rewrites": [ + { + "source": "/:path(.*)", + "has": [{ "type": "host", "value": "(?.+)\\.aethex\\.me" }], + "destination": "/index.html" + }, + { + "source": "/:path(.*)", + "has": [{ "type": "host", "value": "(?.+)\\.aethex\\.space" }], + "destination": "/index.html" + }, + { + "source": "/api/:path(.*)", + "destination": "/api/:path" + }, { "source": "/", "destination": "/index.html" }, { "source": "/login", "destination": "/index.html" }, { "source": "/login/:path*", "destination": "/index.html" },