-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobots.ts
More file actions
45 lines (43 loc) · 1.04 KB
/
robots.ts
File metadata and controls
45 lines (43 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import type { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {
const baseUrl = (process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000").replace(/\/$/, "");
return {
rules: [
{
userAgent: "*",
allow: ["/", "/articles", "/articles/", "/authors/", "/terms", "/privacy", "/moderation-policy", "/reporting", "/login", "/signup"],
disallow: [
"/dashboard/",
"/api/",
"/forgot-password",
"/reset-password",
"/_next/",
"/favicon.ico",
],
},
// Block AI training crawlers
{
userAgent: "GPTBot",
disallow: ["/"],
},
{
userAgent: "ChatGPT-User",
disallow: ["/"],
},
{
userAgent: "CCBot",
disallow: ["/"],
},
{
userAgent: "anthropic-ai",
disallow: ["/"],
},
{
userAgent: "Claude-Web",
disallow: ["/"],
},
],
sitemap: `${baseUrl}/sitemap.xml`,
host: baseUrl,
};
}