diff --git a/apps/web/components/PageWrapper.tsx b/apps/web/components/PageWrapper.tsx index cbd9f19ece..ad7ad649de 100644 --- a/apps/web/components/PageWrapper.tsx +++ b/apps/web/components/PageWrapper.tsx @@ -5,6 +5,8 @@ import Script from "next/script"; import "@calcom/embed-core/src/embed-iframe"; import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired"; +import { WEBAPP_URL } from "@calcom/lib/constants"; +import { buildCanonical } from "@calcom/lib/next-seo.config"; import type { AppProps } from "@lib/app-providers"; import AppProviders from "@lib/app-providers"; @@ -49,9 +51,24 @@ function PageWrapper(props: AppProps) { }; // Use the layout defined at the page level, if available const getLayout = Component.getLayout ?? ((page) => page); + + // Canonical: Check if the URL is from cal.com so that we set the canonical conditionally + const isCalcom = + WEBAPP_URL && + (new URL(WEBAPP_URL).hostname.endsWith("cal.com") || new URL(WEBAPP_URL).hostname.endsWith("cal.dev")); + const path = router.asPath; + return ( - +