Skip to content

Serve a real robots.txt and sitemap instead of the homepage - #9

Open
adamtpang wants to merge 1 commit into
Quantus-Network:mainfrom
adamtpang:fix/robots-and-sitemap
Open

Serve a real robots.txt and sitemap instead of the homepage#9
adamtpang wants to merge 1 commit into
Quantus-Network:mainfrom
adamtpang:fix/robots-and-sitemap

Conversation

@adamtpang

Copy link
Copy Markdown
Contributor

Overview

Follow-on to #8. This commit was pushed to that branch a few seconds before it merged, so GitHub still had the old head and it did not make it in. Nothing was wrong with the merge; the change simply missed the train.

It matters because the AI-crawler fix on the Cloudflare side is now live and working, and this is the one remaining reason migration.fail/robots.txt is still broken.

The problem

This repo has no public/robots.txt, so a request for /robots.txt falls through to the SPA and the origin answers with the homepage. Right now:

https://migration.fail/robots.txt   98,038 bytes, ends in </body></html>
https://vc.fail/robots.txt              66 bytes, clean

/sitemap-index.xml does the same thing and also returns the homepage, so @astrojs/sitemap is added here rather than pointing robots.txt at a URL that does not exist. Both sibling sites already run that integration.

What changed

  • public/robots.txt, matching the wording used by vc.fail and exchange.fail
  • @astrojs/sitemap added to the integrations list

Validation

bun run build with SITE_URL=https://migration.fail emits both files into dist:

dist/robots.txt          User-agent: * / Allow: / + Sitemap line
dist/sitemap-index.xml   <sitemapindex> pointing at /sitemap-0.xml

Note

This does not change which crawlers are allowed, and no longer needs to. The Cloudflare managed block that previously prepended Disallow: / for GPTBot, ClaudeBot, CCBot and Google-Extended is gone as of today, and vc.fail now serves its own file untouched. This change only stops migration.fail answering that path with a full HTML document.

This repo had no public/robots.txt, so requests for /robots.txt fell through
to the SPA and the origin answered with the homepage. Cloudflare then prepends
its managed block to whatever the origin returns, so the live file is
99,432 bytes: a valid robots preamble followed by a full HTML document ending
in </body></html>.

The arithmetic is exact. The origin at pqc-coins.pages.dev returns 97,596
bytes for /robots.txt, Cloudflare injects 1,836, and migration.fail serves
99,432. On vc.fail, which ships a 71-byte robots.txt, the same injection
produces a clean 1,903-byte file. The difference is entirely this missing file.

/sitemap-index.xml had the same problem and returned the homepage too, so the
sitemap integration is added here rather than referencing a URL that does not
exist. Both sibling sites already run it.

After this, dist contains a four-line robots.txt and a real sitemap-index.xml
pointing at https://migration.fail/sitemap-0.xml.

Note that this does not change which crawlers are allowed. Cloudflare's
managed block is prepended ahead of this file and names GPTBot, ClaudeBot,
CCBot, Google-Extended and others directly, and a named group always wins over
the wildcard here. That is a dashboard setting, not a repo one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant