Skip to content

Alias /sitemap.xml on both sites + recover orphaned newTab commit#17

Merged
radinhamidi merged 2 commits intomainfrom
fix/sitemap-alias
Apr 30, 2026
Merged

Alias /sitemap.xml on both sites + recover orphaned newTab commit#17
radinhamidi merged 2 commits intomainfrom
fix/sitemap-alias

Conversation

@radinhamidi
Copy link
Copy Markdown
Member

TL;DR

Both sitemap-index URLs are healthy (HTTP 200, valid XML, correct content-type, robots allows). I verified live with both regular curl and a Googlebot user-agent:

```
$ curl -s https://querygym.com/sitemap-index.xml
...https://querygym.com/sitemap-0.xml...

$ curl -s https://leaderboard.querygym.com/sitemap-index.xml
...https://leaderboard.querygym.com/sitemap-0.xml...
```

The sitemap files aren't broken. What was broken: `/sitemap.xml` (no `-index`) returned 404 on both sites — and that's the URL Google Search Console's "Add a sitemap" form auto-suggests when you start typing. If you submitted `sitemap.xml` to GSC, you'd get "Couldn't fetch" because that path 404'd.

Fix

Adds a rewrite to each project's `public/_redirects`:

```
/sitemap.xml /sitemap-index.xml 200
```

Status `200` is a rewrite (URL stays the same in the browser), not a redirect — `/sitemap.xml` now serves the index content directly. Both URLs work; either is valid to submit.

Also includes a recovery commit

PR #16 was merged before my final commit `9ba7648` ("Top-menu linkouts use new tab") landed in it. Cherry-picked here so:

  • Marketing top nav: Docs/Leaderboard/Dashboard linkouts → new tab
  • Leaderboard top nav: Toolkit linkout → new tab
  • Footer + in-page links: same tab

After merge

  1. CF Pages auto-redeploys both sites.
  2. `https://querygym.com/sitemap.xml\` and `https://leaderboard.querygym.com/sitemap.xml\` will return 200 with the sitemap-index content.
  3. Retry GSC submission with either form:
  4. Note: GSC "Couldn't fetch" is also frequently transient for 24–48h while Google gets around to crawling. If `curl -I` returns 200, the submission is healthy.

GSC checklist (independent of this PR)

If submission still fails after the fix is deployed:

Check Command / where
URL returns 200 `curl -I https://querygym.com/sitemap.xml\`
Content-Type is XML `curl -I` shows `content-type: application/xml`
Property scope covers the host GSC → property settings → verified domain matches
Domain property recommended GSC supports one Domain property covering both `querygym.com` AND `leaderboard.querygym.com`
Wait 24–48h "Couldn't fetch" is often pending, not failed

Test plan

  • `pnpm -F @qg/site build` includes the rewrite in `dist/_redirects`.
  • `pnpm -F @qg/leaderboard build` includes the rewrite.
  • After CF deploy: `curl -I https://querygym.com/sitemap.xml\` returns 200.
  • Same for leaderboard.
  • GSC re-submission succeeds (or shows "Pending" briefly before success).

🤖 Generated with Claude Code

radinhamidi and others added 2 commits April 29, 2026 23:28
Refined behavior per user feedback:
- Top nav linkout items (Dashboard, Leaderboard, Docs on the
  marketing site; Toolkit on the leaderboard) now open in a new tab.
  Rationale: users navigating the menu bar are mid-task on the
  current page; sibling-site jumps shouldn't blow away their context.
- Footer and in-page linkouts stay same-tab. Footer is rarely
  read at the top of attention; in-page references already get
  middle-click for new tab if the reader wants one.

Implemented via the existing Header `newTab` prop (separate from
`external` which only renders the icon). external + newTab are
intentionally orthogonal so we can vary them per surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Google Search Console's "Add a sitemap" form auto-suggests
/sitemap.xml when you start typing — and a lot of other tools
(Bing, Yandex, IndexNow probes, humans) try /sitemap.xml first.
@astrojs/sitemap only emits /sitemap-index.xml + /sitemap-0.xml,
so /sitemap.xml was 404'ing on both querygym.com and
leaderboard.querygym.com. That's the most likely cause of the GSC
"Couldn't fetch" reports — the sitemap-index URL itself is fine.

Fix: add a 200 rewrite (not a 301 redirect) in each project's
_redirects so /sitemap.xml serves the index content directly. The
200 keeps the canonical URL stable for crawlers that already know
about /sitemap-index.xml; new submitters can use either form.

Verified locally: both build outputs include the rewrite rules
in dist/_redirects.

After deploy, retry GSC submission with whichever URL you prefer:
  https://querygym.com/sitemap.xml
  https://querygym.com/sitemap-index.xml
  https://leaderboard.querygym.com/sitemap.xml
  https://leaderboard.querygym.com/sitemap-index.xml

Note: GSC "Couldn't fetch" status is also commonly transient for
the first 24-48h while Google gets around to crawling. If the URL
returns 200 in a browser, the submission is healthy.

Also includes the orphaned-from-PR-#16 commit:
"Top-menu linkouts use new tab; footer/in-page stay same-tab"
which got pushed after that PR's merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@radinhamidi radinhamidi merged commit 8e7d95b into main Apr 30, 2026
3 checks passed
@radinhamidi radinhamidi deleted the fix/sitemap-alias branch April 30, 2026 05:20
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