Skip to content

Commit 40e8e69

Browse files
authored
Disallow crawling by web-robots of search/ask URLs (#3035)
1 parent e84a46a commit 40e8e69

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/late-teachers-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Disallow crawling by web-robots of search/ask URLs

packages/gitbook/src/routes/robots.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export async function serveRobotsTxt(context: GitBookSiteContext) {
1010
const isRoot = checkIsRootSiteContext(context);
1111
const lines = [
1212
'User-agent: *',
13+
// Disallow image resizing
1314
'Disallow: /~gitbook/',
15+
// Disallow dynamic routes / search queries
16+
'Disallow: /*?',
1417
...((await isSiteIndexable(context))
1518
? [
1619
'Allow: /',

0 commit comments

Comments
 (0)