Add robots.txt and sitemap.xml (both currently return HTML) - #25
Open
BigChrisCooke wants to merge 2 commits into
Open
Add robots.txt and sitemap.xml (both currently return HTML)#25BigChrisCooke wants to merge 2 commits into
BigChrisCooke wants to merge 2 commits into
Conversation
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.
The problem
Both control paths return the app shell instead of the file search engines expect:
Neither file exists in
public/, sospaHandlerinbackend-go/main.gofalls through toindex.html— it serves any file present on disk and only falls back whenos.Statfails.Net effect: the site has no crawl directives and no URL list, and a crawler asking for
sitemap.xmlgets a web page with atext/htmlcontent type.The change
Two static files in
public/. No Go change needed — the server already serves whatever exists; it just had nothing to serve.robots.txtallows all crawlers, including AI assistants, and declares the sitemap. For a directory of alternatives, being citable is rather the point.sitemap.xmllists the single public route.lastmodis omitted rather than invented, since there is no reliable substantive-edit date.How this was found
The identical defect was fixed on
realigned.ioon 2026-08-16 during an SEO audit — same GospaHandlerpattern, same cause, same one-line-of-effort fix. Verified there afterwards:robots.txtreturnstext/plainandsitemap.xmlreturnstext/xml, with no other behaviour changed.Not included
Unknown paths here still return 200 with the homepage, so typos and dead links look like valid pages. On
realigned.iothat turned out to be more than theoretical — Google had crawled a URL that did not exist, received a 200, and filed it under Crawled – currently not indexed.That fix is a small change to
spaHandler(serve a real 404 for anything that is neither a file nor a known route), but it touches the server rather than adding static files, so it is kept out of this PR. Happy to open it separately if useful.Verifying after merge
Submitting the sitemap in Search Console afterwards is what actually gets the URL discovered.
🤖 Generated with Claude Code