Skip to content

seo: flip canonical to https://www.statewave.ai#93

Merged
smaramwbc merged 1 commit into
mainfrom
seo-canonical-flip-to-www
May 25, 2026
Merged

seo: flip canonical to https://www.statewave.ai#93
smaramwbc merged 1 commit into
mainfrom
seo-canonical-flip-to-www

Conversation

@smaramwbc
Copy link
Copy Markdown
Owner

Summary

Vercel's project-level redirect makes the apex (`statewave.ai`) 308 to `www.statewave.ai`, so www is the live canonical. Until now our static metadata claimed the opposite — `` pointed at the apex, OG/Twitter URLs and JSON-LD `url` fields used the apex, sitemap and `llms.txt` listed apex URLs.

That mismatch is the genuine half of what the external SEO audit caught. They got the recommended direction backward (#91 attempted to enforce apex-as-canonical and tripped an infinite redirect loop — reverted in #92). This PR fixes it properly by aligning every static surface with the live infra.

Surface flipped

  • `src/lib/seo-meta.ts` `BASE_URL` — drives every SPA-managed canonical, Open Graph `url`, breadcrumb `item`, and per-route JSON-LD `url`.
  • `index.html` — canonical link, OG/Twitter `url` + image absolute URLs, Organization/WebSite/SoftwareApplication JSON-LD `url` fields, logo URL.
  • `public/sitemap.xml` — six route URLs.
  • `public/robots.txt` — `Sitemap:` line.
  • `public/llms.txt` + `public/llms-full.txt` — primary links and self-reference.
  • `src/pages/TermsPage.tsx` + `src/pages/ImpressumPage.tsx` — visible legal-page `href`s. Display text `statewave.ai` kept as the user-facing brand string; only the `href` flipped, so clicks no longer trigger the 308 hop.
  • `tests/seo-jsonld.test.tsx` + `tests/seo-static.test.ts` — expectations on `Organization.url`, breadcrumb `item`, sitemap URLs, and the canonical-link regex against built `index.html`.

What did not change

  • `server/handlers/launch-signup.ts` `ALLOWED_HOSTS` and `tests/faq-links.test.tsx` `STATEWAVE_HOSTS` already accept both apex and www — no behaviour change there.
  • `tests/launch-signup.test.ts` intentionally still posts with `origin=apex` to keep that regression covered.

Test plan

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
statewave-web Ready Ready Preview, Comment May 25, 2026 10:12am

Request Review

Vercel's project-level redirect makes the apex (statewave.ai) 308 to
www.statewave.ai, so www is the live canonical. Until now our static
metadata claimed the opposite — <link rel="canonical"> pointed at the
apex, OG/Twitter URLs and JSON-LD url fields used the apex, sitemap
and llms.txt listed apex URLs. That mismatch is what the external SEO
audit caught, though they had the recommended direction backward.

This commit aligns every static surface with the infra:

* src/lib/seo-meta.ts BASE_URL — drives every SPA-managed canonical,
  Open Graph url, breadcrumb item, and per-route JSON-LD url.
* index.html — canonical link, OG/Twitter url + image absolute URLs,
  Organization/WebSite/SoftwareApplication JSON-LD url fields, logo.
* public/sitemap.xml — six route URLs.
* public/robots.txt — Sitemap line.
* public/llms.txt + llms-full.txt — primary links and self-reference.
* src/pages/TermsPage.tsx + ImpressumPage.tsx — visible legal-page
  hrefs (display text "statewave.ai" kept as the user-facing brand
  string; only href flipped so clicks don't trigger the 308 hop).
* tests/seo-jsonld.test.tsx + tests/seo-static.test.ts — expectations
  on Organization.url, breadcrumb item, sitemap URLs, and the canonical
  regex against built index.html.

Server-side allow-lists (server/handlers/launch-signup.ts ALLOWED_HOSTS
and tests/faq-links.test.tsx STATEWAVE_HOSTS) already accept both apex
and www, so no behaviour change there. tests/launch-signup.test.ts
intentionally still posts with origin=apex to keep that regression
covered.

Full suite green locally (276/276).
@smaramwbc smaramwbc force-pushed the seo-canonical-flip-to-www branch from 50766d1 to 277764c Compare May 25, 2026 10:12
@smaramwbc smaramwbc merged commit b35c1e7 into main May 25, 2026
6 checks passed
@smaramwbc smaramwbc deleted the seo-canonical-flip-to-www branch May 25, 2026 10:14
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