Skip to content

fix: canonicalize vibedeveloper.id for search and WhatsApp links - #43

Open
julianromli wants to merge 3 commits into
mainfrom
julianromli/canonical-vibedeveloper-id-8490
Open

fix: canonicalize vibedeveloper.id for search and WhatsApp links#43
julianromli wants to merge 3 commits into
mainfrom
julianromli/canonical-vibedeveloper-id-8490

Conversation

@julianromli

Copy link
Copy Markdown
Owner

Point robots, sitemap, canonical tags, and structured data at https://vibedeveloper.id. 301 www and vibedevid.com hosts to the apex. Keep /sitemap.xml on HTTP 200 when the database query fails. Change community buttons to https://wa.vibedeveloper.id.

Point robots, sitemap, canonical tags, and structured data at
https://vibedeveloper.id. 301 www and vibedevid.com hosts to the apex.
Keep /sitemap.xml on HTTP 200 when the database query fails. Change
community buttons to https://wa.vibedeveloper.id.

Co-authored-by: faizintifada <faizintifada@gmail.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 7, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
vibedevid ddaec72 Commit Preview URL

Branch Preview URL
Sep 07 2026, 02:16 AM

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 040e5560-d85f-48dc-a8ef-6de2e7601332


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.

@julianromli

Copy link
Copy Markdown
Owner Author

@cursoragent review

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

The SEO cutover on this branch is correct. I posted the same review on PR #43.

Verified on the Cloudflare preview

  • /robots.txtHost and Sitemap are https://vibedeveloper.id
  • /sitemap.xml — HTTP 200, XML, every loc on the new apex
  • Homepage — one canonical and matching og:url
  • Join Community / announcement — https://wa.vibedeveloper.id

The old duplicate-canonical bug is gone: the root layout no longer puts a homepage canonical on every page. Event pages now use an absolute canonical.

Do not block merge on Biome CI. lint:ci already fails on main (biome check . --error-on-warnings across the whole repo). This PR did not introduce that.

Still required after merge (not in this diff)

  1. Point vibedevid.com DNS at this Worker, or set a registrar 301. That host is still a separate Apache site, so the in-app 301 cannot run yet.
  2. Create wa.vibedeveloper.id.
  3. Skip Cloudflare Bot Fight on /sitemap.xml and /robots.txt so Google can fetch them.
  4. Rebuild with VITE_SITE_URL=https://vibedeveloper.id and set the Worker secrets.
Open in Web Open in Cursor 

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review

The canonical cutover works on the Cloudflare preview for this branch.

Verified on https://julianromli-canonical-vibedeveloper-id-8490-vibedevid.faizintifada.workers.dev:

  • /robots.txtSitemap and Host are https://vibedeveloper.id (no vibedevid.com)
  • /sitemap.xml — HTTP 200, application/xml, locs on https://vibedeveloper.id
  • Homepage — one canonical https://vibedeveloper.id, matching og:url
  • Join Community / announcement — https://wa.vibedeveloper.id

The root layout no longer emits a homepage canonical on every page, which was a real duplicate-canonical signal. Event detail canonicals are absolute now.

getSiteUrl() rewrites www and vibedevid.com even if a Worker secret still holds the old domain. That is the right guard.

Blockers outside this PR

  1. vibedevid.com DNS still points at a separate Apache host, not this Worker. The 301 in middleware cannot run until that host is on Cloudflare or a registrar 301 is set.
  2. wa.vibedeveloper.id must exist in DNS after merge.
  3. Cloudflare Bot Fight still challenges /sitemap.xml on the live apex from some IPs. Skip that path (and /robots.txt) for Googlebot.
  4. Biome lint:ci fails on this PR, but it already fails on main (biome check . --error-on-warnings, 500+ format/lint hits in files this PR does not touch). Do not treat it as a regression from this change.

Nits (not merge blockers)

  • Several files mix quote/semicolon-only Biome churn with the real SEO edits. Harder to review, no runtime effect.
  • Homepage still emits two Organization JSON-LD blocks (root + home structured data). That was already true before this PR.

After merge: rebuild with VITE_SITE_URL=https://vibedeveloper.id, set NEXT_PUBLIC_SITE_URL / BETTER_AUTH_URL, then fix DNS for the old domain and the WhatsApp subdomain.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 30 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/start.ts">

<violation number="1" location="app/start.ts:16">
P1: When a POST-based server function is called on an alias host, this middleware returns a 301 before the handler runs. Fetch follows that redirect as GET, so mutations and sign-in requests fail; use a method-preserving 308 for non-GET/HEAD requests and retain 301 for GET/HEAD.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/seed/guards.ts Outdated
Comment thread app/start.ts

const canonicalHostMiddleware = createMiddleware().server(async ({ request, next }) => {
const redirect = applyCanonicalHostRedirect(request)
if (redirect) return redirect

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: When a POST-based server function is called on an alias host, this middleware returns a 301 before the handler runs. Fetch follows that redirect as GET, so mutations and sign-in requests fail; use a method-preserving 308 for non-GET/HEAD requests and retain 301 for GET/HEAD.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/start.ts, line 16:

<comment>When a POST-based server function is called on an alias host, this middleware returns a 301 before the handler runs. Fetch follows that redirect as GET, so mutations and sign-in requests fail; use a method-preserving 308 for non-GET/HEAD requests and retain 301 for GET/HEAD.</comment>

<file context>
@@ -1,41 +1,44 @@
+
+const canonicalHostMiddleware = createMiddleware().server(async ({ request, next }) => {
+  const redirect = applyCanonicalHostRedirect(request)
+  if (redirect) return redirect
+  return next()
+})
</file context>
Suggested change
if (redirect) return redirect
if (redirect) {
if (request.method === 'GET' || request.method === 'HEAD') return redirect
return new Response(null, { status: 308, headers: redirect.headers })
}

Comment thread components/sections/home-structured-data.tsx Outdated
Comment thread lib/seo/site-url.ts
Comment thread config/site.ts Outdated
Comment thread lib/seo/sitemap-xml.ts Outdated
cursoragent and others added 2 commits September 7, 2026 02:14
Drop unused siteConfig, share XML escaping, strip DNS trailing-dot
hosts, use 308 for non-GET alias redirects, and stop reading process.env
at client module load.

Co-authored-by: faizintifada <faizintifada@gmail.com>
Co-authored-by: faizintifada <faizintifada@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 12 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="lib/seo/site-url.ts">

<violation number="1" location="lib/seo/site-url.ts:32">
P1: When the edge runtime exposes `process` without an `env` object, `readProcessEnv` throws before `getSiteUrl()` can use the Worker binding or Vite fallback. Read the environment through optional chaining, matching `runtime-secrets.ts`.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread lib/seo/site-url.ts

function readProcessEnv(name: string): string | undefined {
if (typeof process === 'undefined') return undefined
const value = process.env[name]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: When the edge runtime exposes process without an env object, readProcessEnv throws before getSiteUrl() can use the Worker binding or Vite fallback. Read the environment through optional chaining, matching runtime-secrets.ts.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/seo/site-url.ts, line 32:

<comment>When the edge runtime exposes `process` without an `env` object, `readProcessEnv` throws before `getSiteUrl()` can use the Worker binding or Vite fallback. Read the environment through optional chaining, matching `runtime-secrets.ts`.</comment>

<file context>
@@ -27,6 +27,14 @@ function readWorkerEnv(name: string): string | undefined {
 
+function readProcessEnv(name: string): string | undefined {
+  if (typeof process === 'undefined') return undefined
+  const value = process.env[name]
+  if (typeof value !== 'string') return undefined
+  const trimmed = value.trim()
</file context>
Suggested change
const value = process.env[name]
const value = process.env?.[name]

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.

2 participants