I spent 2 days debugging why Google wouldn't index my new SaaS — the bug was in my own canonical tags

작성자

카테고리:

← 피드로
DEV Community · Yoon Hun Kang · 2026-07-21 개발(SW)

Yoon Hun Kang

Launched a new site two days ago and Google Search Console showed
zero indexing. Spent longer than I’d like to admit assuming it was
just “new domain, be patient” — until I actually checked the live HTML.

The bug

My server correctly redirects uxtion.aiwww.uxtion.ai (301/308).
Standard setup. But every canonical tag on the page — and the JSON-LD
schema, and the sitemap — still pointed back to the non-www version.

So Google was getting two contradicting signals on the same page:

  • “The real URL is www” (from the redirect)
  • “No wait, the real URL is non-www” (from the canonical tag)

Classic case of shipping the redirect and forgetting the metadata
has to agree with it.

The fix

Pulled every hardcoded domain reference into a single shared constant
tied to the actual production env var, instead of a string typed out
in six different files. Once that shipped and the sitemap re-read
correctly, the homepage went from “not indexed” to “URL is on Google”
within a few days.

Why I’m writing this

I’m building UXtion — a tool that audits Lovable
and Cursor-built sites and hands back paste-ready fixes instead of
another report to interpret. Ironically, this bug was in my own
marketing site, not a customer’s. Turns out “diagnose the problem vs.
actually fix it” applies to your own infrastructure too.

If you’re running a Next.js App Router site with a www/apex split,
worth checking alternates.canonical and any JSON-LD @id/url
fields aren’t hardcoded to the wrong domain — tsc and your test
suite won’t catch this, only a live view-source will.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다