fix: rewrite canonical URL of Framer-hosted homepage to zenstack.dev - #629
Conversation
The / route is rewritten to zenstack.framer.website (vercel.json), so the page served at zenstack.dev declared the Framer domain as its canonical and og:url. Add Vercel Edge Middleware that proxies the Framer page and rewrites those URLs to https://zenstack.dev. On any failure it falls through to the existing plain rewrite. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. WalkthroughVercel Edge Middleware now proxies ChangesLanding page proxy
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant EdgeMiddleware
participant FramerLandingPage
Browser->>EdgeMiddleware: Request /
EdgeMiddleware->>FramerLandingPage: Fetch landing page
FramerLandingPage-->>EdgeMiddleware: HTML response
EdgeMiddleware-->>Browser: Rewritten HTML response
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@middleware.ts`:
- Around line 18-24: Update the middleware function’s upstream fetch to forward
the incoming request’s relevant headers and preserve its URL search string when
constructing the Framer origin URL. Use the middleware request context, copy the
client headers rather than replacing them with only Accept, and append the
original query parameters so analytics and server-side features receive the same
request data.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…enstackhq#629) * fix: rewrite canonical URL of Framer-hosted homepage to zenstack.dev The / route is rewritten to zenstack.framer.website (vercel.json), so the page served at zenstack.dev declared the Framer domain as its canonical and og:url. Add Vercel Edge Middleware that proxies the Framer page and rewrites those URLs to https://zenstack.dev. On any failure it falls through to the existing plain rewrite. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: remove log * fix: forward query string and safe request headers to Framer upstream Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: forward referer and x-forwarded-for headers to Framer upstream Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Problem
Since #627,
/is rewritten to the Framer-hosted landing page (zenstack.framer.website) viavercel.json. A plain rewrite passes the body through untouched, so the page served atzenstack.devdeclares the Framer domain in its<link rel="canonical">andog:urltags — telling search engines the canonical home of the site iszenstack.framer.website.Solution
Add Vercel Edge Middleware (
middleware.ts, matched only on/) that fetches the Framer page and replaces the Framer origin withhttps://zenstack.devbefore returning the HTML. The hostname appears exactly twice in the page (canonical + og:url), so a full-origin replacement is safe and fixes both.The existing rewrite in
vercel.jsonis kept as a fallback: if the middleware's fetch fails or returns non-HTML, it returnsundefinedand the request falls through to the plain rewrite, serving the unmodified Framer page instead of erroring.Testing
<link rel="canonical" href="https://zenstack.dev/">and<meta property="og:url" content="https://zenstack.dev/">, zero remainingzenstack.framer.websitereferences.curl -s https://zenstack.dev/ | grep -E 'canonical|og:url'🤖 Generated with Claude Code
Summary by CodeRabbit