seo: flip canonical to https://www.statewave.ai#93
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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).
50766d1 to
277764c
Compare
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.
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
What did not change
Test plan