Skip to content

Commit fac1226

Browse files
committed
add robots.txt
1 parent 9a0d54f commit fac1226

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

nginx.conf.sigil

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,40 @@ server {
167167
rewrite ^ /$current_version.x/sitemap.xml last;
168168
}
169169

170+
# Serve robots.txt
171+
location = /robots.txt {
172+
add_header Content-Type text/plain;
173+
return 200 "# CakePHP Documentation - robots.txt
174+
User-agent: *
175+
176+
# Default: Allow everything
177+
Allow: /
178+
179+
# Block deprecated language paths (these redirect)
180+
Disallow: /*/fr/
181+
Disallow: /*/pt/
182+
Disallow: /*/es/
183+
Disallow: /*/ru/
184+
Disallow: /*/tr/
185+
Disallow: /*/zh/
186+
Disallow: /*/de/
187+
Disallow: /*/ms/
188+
Disallow: /*/go/
189+
Disallow: /*/en/
190+
191+
# Block development versions (constantly changing)
192+
Disallow: /*.next/
193+
194+
# Block legacy versions (redirect to legacybook.cakephp.org)
195+
Disallow: /1.1/
196+
Disallow: /1.2/
197+
Disallow: /1.3/
198+
199+
# Sitemap
200+
Sitemap: https://book.cakephp.org/sitemap.xml
201+
";
202+
}
203+
170204
# ========================================
171205
# Version root and language redirects
172206
# ========================================

0 commit comments

Comments
 (0)