From b93608dfc622f9aa39ee73b64034df838355c2c9 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Tue, 6 May 2025 18:34:48 +0100 Subject: [PATCH] Stop indexing the test-cloud domain --- apps/webapp/app/root.tsx | 5 ++++- apps/webapp/server.ts | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/webapp/app/root.tsx b/apps/webapp/app/root.tsx index bd3f7c5a6e..2256e8af19 100644 --- a/apps/webapp/app/root.tsx +++ b/apps/webapp/app/root.tsx @@ -40,7 +40,10 @@ export const meta: MetaFunction = ({ data }) => { }, { name: "robots", - content: typedData.features.isManagedCloud ? "index, follow" : "noindex, nofollow", + content: + typeof window === "undefined" || window.location.hostname !== "cloud.trigger.dev" + ? "noindex, nofollow" + : "index, follow", }, ]; }; diff --git a/apps/webapp/server.ts b/apps/webapp/server.ts index 4b4a6a843e..e707d71b28 100644 --- a/apps/webapp/server.ts +++ b/apps/webapp/server.ts @@ -64,6 +64,11 @@ if (process.env.HTTP_SERVER_DISABLED !== "true") { // helpful headers: res.set("Strict-Transport-Security", `max-age=${60 * 60 * 24 * 365 * 100}`); + // Add X-Robots-Tag header for test-cloud.trigger.dev + if (req.hostname !== "cloud.trigger.dev") { + res.set("X-Robots-Tag", "noindex, nofollow"); + } + // /clean-urls/ -> /clean-urls if (req.path.endsWith("/") && req.path.length > 1) { const query = req.url.slice(req.path.length);