Skip to content

fix: rewrite canonical URL of Framer-hosted homepage to zenstack.dev - #629

Merged
ymc9 merged 4 commits into
mainfrom
fix/homepage-canonical-url
Jul 15, 2026
Merged

fix: rewrite canonical URL of Framer-hosted homepage to zenstack.dev#629
ymc9 merged 4 commits into
mainfrom
fix/homepage-canonical-url

Conversation

@ymc9

@ymc9 ymc9 commented Jul 15, 2026

Copy link
Copy Markdown
Member

Problem

Since #627, / is rewritten to the Framer-hosted landing page (zenstack.framer.website) via vercel.json. A plain rewrite passes the body through untouched, so the page served at zenstack.dev declares the Framer domain in its <link rel="canonical"> and og:url tags — telling search engines the canonical home of the site is zenstack.framer.website.

Solution

Add Vercel Edge Middleware (middleware.ts, matched only on /) that fetches the Framer page and replaces the Framer origin with https://zenstack.dev before 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.json is kept as a fallback: if the middleware's fetch fails or returns non-HTML, it returns undefined and the request falls through to the plain rewrite, serving the unmodified Framer page instead of erroring.

Testing

  • Ran the compiled middleware against the live Framer page: output contains <link rel="canonical" href="https://zenstack.dev/"> and <meta property="og:url" content="https://zenstack.dev/">, zero remaining zenstack.framer.website references.
  • After deploy, verify with: curl -s https://zenstack.dev/ | grep -E 'canonical|og:url'

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a refreshed landing page experience for the root URL.
    • Landing page content is served seamlessly from the canonical site address.
    • Added fallback behavior to preserve the existing page delivery if the refreshed experience is unavailable.

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>
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
zenstack-new-site Ready Ready Preview, Comment Jul 15, 2026 2:16am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ymc9, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0887e027-1475-4cd7-8884-638c21fbacad

📥 Commits

Reviewing files that changed from the base of the PR and between 4f33ee1 and fa63c5b.

📒 Files selected for processing (1)
  • middleware.ts

Walkthrough

Vercel Edge Middleware now proxies / to the Framer-hosted landing page, rewrites embedded Framer origins to https://zenstack.dev, removes incompatible response headers, and falls through to existing rewrite behavior on failure or non-HTML responses.

Changes

Landing page proxy

Layer / File(s) Summary
Root route middleware proxy
middleware.ts
The root matcher fetches the Framer landing page, rewrites HTML origin references, removes content-encoding and content-length, and returns undefined for fallback handling.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: rewriting the Framer-hosted homepage to use zenstack.dev as the canonical URL.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/homepage-canonical-url

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b59db95b-c047-4a0e-aea6-8331027e583f

📥 Commits

Reviewing files that changed from the base of the PR and between 3fe2992 and 4f33ee1.

📒 Files selected for processing (1)
  • middleware.ts

Comment thread middleware.ts Outdated
ymc9 and others added 2 commits July 15, 2026 10:14
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ymc9
ymc9 merged commit bf4c80d into main Jul 15, 2026
4 checks passed
@ymc9
ymc9 deleted the fix/homepage-canonical-url branch July 15, 2026 02:18
sanny-io pushed a commit to sanny-io/zenstack-docs that referenced this pull request Jul 31, 2026
…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>
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