Skip to content

Commit cd17f80

Browse files
gkhngykclaude
andauthored
chore(seo): block search indexing on the app subdomain (#3)
The product app is moving to app.ansvisor.com while the marketing site is hosted separately on Webflow at ansvisor.com. Authenticated dashboard pages should never appear in search results, both because they leak nothing useful to crawlers and because surfacing /sign-in / /dashboard URLs in SERPs hurts the marketing funnel. Three layers of opt-out, applied together so any one is enough: 1. Next.js robots.ts emits a Disallow: / robots.txt for *all bots 2. Root layout metadata sets robots.index/follow = false (and the same for googleBot specifically), which renders <meta name="robots" content="noindex, nofollow"> on every page 3. Vercel.json adds X-Robots-Tag: noindex, nofollow, noarchive, nosnippet as a response header, the strongest signal because it also covers non-HTML resources Marketing site at ansvisor.com is unaffected — it's served from a different origin (Webflow) and keeps default indexing behavior. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 910fe22 commit cd17f80

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎web/src/app/layout.tsx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ export const metadata: Metadata = {
3030
},
3131
description:
3232
"Monitor, analyze, and optimize your brand's visibility in AI-powered search engines.",
33+
// The product app at app.ansvisor.com should not appear in search results;
34+
// ansvisor.com (the Webflow marketing site) is the indexable surface.
35+
robots: {
36+
index: false,
37+
follow: false,
38+
googleBot: {
39+
index: false,
40+
follow: false,
41+
},
42+
},
3343
};
3444

3545
export default function RootLayout({

‎web/src/app/robots.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { MetadataRoute } from 'next';
2+
3+
/**
4+
* Block search engines from indexing the application subdomain.
5+
*
6+
* The marketing site at `ansvisor.com` is hosted separately (Webflow) and
7+
* is the surface that should be indexed. The Next.js app at `app.ansvisor.com`
8+
* is purely the authenticated product UI and provides no value in search.
9+
*/
10+
export default function robots(): MetadataRoute.Robots {
11+
return {
12+
rules: [
13+
{
14+
userAgent: '*',
15+
disallow: '/',
16+
},
17+
],
18+
};
19+
}

‎web/vercel.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,16 @@
44
"path": "/api/cron/daily-tracking",
55
"schedule": "45 15 * * *"
66
}
7+
],
8+
"headers": [
9+
{
10+
"source": "/(.*)",
11+
"headers": [
12+
{
13+
"key": "X-Robots-Tag",
14+
"value": "noindex, nofollow, noarchive, nosnippet"
15+
}
16+
]
17+
}
718
]
819
}

0 commit comments

Comments
 (0)