Serve a real robots.txt and sitemap instead of the homepage - #9
Open
adamtpang wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.txtis still broken.The problem
This repo has no
public/robots.txt, so a request for/robots.txtfalls through to the SPA and the origin answers with the homepage. Right now:/sitemap-index.xmldoes the same thing and also returns the homepage, so@astrojs/sitemapis 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/sitemapadded to the integrations listValidation
bun run buildwithSITE_URL=https://migration.failemits both files intodist: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.