Skip to content

Commit e94558a

Browse files
authored
Stop indexing the test-cloud domain (#2026)
1 parent 6f4af89 commit e94558a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

apps/webapp/app/root.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export const meta: MetaFunction = ({ data }) => {
4040
},
4141
{
4242
name: "robots",
43-
content: typedData.features.isManagedCloud ? "index, follow" : "noindex, nofollow",
43+
content:
44+
typeof window === "undefined" || window.location.hostname !== "cloud.trigger.dev"
45+
? "noindex, nofollow"
46+
: "index, follow",
4447
},
4548
];
4649
};

apps/webapp/server.ts

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ if (process.env.HTTP_SERVER_DISABLED !== "true") {
6464
// helpful headers:
6565
res.set("Strict-Transport-Security", `max-age=${60 * 60 * 24 * 365 * 100}`);
6666

67+
// Add X-Robots-Tag header for test-cloud.trigger.dev
68+
if (req.hostname !== "cloud.trigger.dev") {
69+
res.set("X-Robots-Tag", "noindex, nofollow");
70+
}
71+
6772
// /clean-urls/ -> /clean-urls
6873
if (req.path.endsWith("/") && req.path.length > 1) {
6974
const query = req.url.slice(req.path.length);

0 commit comments

Comments
 (0)