Skip to content

feat: canonicalize www.seofixkit.com onto the apex host with 301 redirects - #70

Merged
nish3451 merged 1 commit into
mainfrom
seo-fix-kit/lane1-www-canonicalize
Aug 9, 2026
Merged

nish3451 merged 1 commit into
mainfrom
seo-fix-kit/lane1-www-canonicalize

Conversation

@nish3451

@nish3451 nish3451 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

What

Closes lane 1: www.seofixkit.com now 301-redirects onto the apex host seofixkit.com, and every URL the Worker serves (page canonicals, social tags, robots.txt, sitemap.xml, llms.txt, fixture URLs) is generated from the apex origin — so canonicals and the sitemap are apex-only.

How

  • worker/index.js — the www.seofixkit.com custom domain stays attached only so its requests reach the Worker; the fetch handler now 301-redirects every www request to the apex host with path and query intact before any route logic runs. canonicalOrigin() coerces the apex/www host family to https://seofixkit.com for all content generation (pages, robots, sitemap, llms.txt, fixtures) as defense in depth; other hosts (local dev, preview) keep their own origin.
  • worker/index.test.mjs — pins the 301s (root, deep path with query, API route, sitemap) and apex-only canonicals/robots/sitemap/llms.txt on the apex host.
  • scripts/live-promise-spot-check.mjs — adds canonicalHostSpotChecks so the deployed Worker's www redirect is live spot-checked like the other README promises (redirect: "manual" keeps the 301 observable; header expectations verify the apex Location with path+query preserved). Runner supports check.url, check.expectedHeaders, and check.redirectManual.
  • scripts/live-promise-spot-check.test.mjs — coverage, pass, and failure-mode tests (www serving 200; redirect dropping path/query).
  • README.md — Custom domain section documents the canonical-host behavior; spot-check paragraph covers the www redirect.

Validation

  • npm run check (the single PR gate): exit 0 — 311 tests pass, 0 fail, vite build succeeds.
  • npm run audit:live-promise is the opt-in live check (not run in CI); it now also verifies the deployed www redirect once this ships.

Note: public/robots.txt and public/sitemap.xml were already apex-only and are shadowed by the Worker routes, so no change was needed there.

…rects

www.seofixkit.com stays attached as a custom domain only so its requests
reach the Worker, which now 301-redirects every one of them onto the apex
host with path and query intact before any route logic runs. Every URL the
Worker emits (page canonicals, social tags, robots.txt, sitemap.xml,
llms.txt, fixture URLs) is generated from the apex origin, so canonicals
and the sitemap are apex-only regardless of the request hostname.

Offline locks:
- worker/index.test.mjs pins the 301s (root, deep path with query, API
  route, sitemap) and apex-only canonicals/robots/sitemap/llms.txt.
- scripts/live-promise-spot-check.mjs adds canonicalHostSpotChecks so the
  deployed Worker's www redirect is spot-checked like the other README
  promises (redirect: manual keeps the 301 observable), with pass and
  failure-mode tests.

Docs:
- README Custom domain section states the canonical-host behavior; the
  spot-check paragraph covers the www redirect.

@greptile-apps greptile-apps 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.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 1 minute

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 015a23d3-1105-4517-9f2e-88a91803fe54

📥 Commits

Reviewing files that changed from the base of the PR and between 367c3f9 and b1115d2.

📒 Files selected for processing (5)
  • README.md
  • scripts/live-promise-spot-check.mjs
  • scripts/live-promise-spot-check.test.mjs
  • worker/index.js
  • worker/index.test.mjs

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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1115d2a76

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread worker/index.js
Comment on lines +190 to +193
if (url.hostname.toLowerCase() === `www.${CANONICAL_HOST}`) {
return new Response(null, {
status: 301,
headers: secureHeaders({ Location: `${CANONICAL_ORIGIN}${url.pathname}${url.search}` })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route all www paths through the Worker

With the production wrangler.jsonc inspected here, assets.not_found_handling is single-page-application and assets.run_worker_first is only a path allowlist, so requests such as https://www.seofixkit.com/old-page or direct static-asset URLs can be answered by Static Assets without ever reaching this redirect. Those requests can therefore return 200 instead of the promised 301; route all paths through the Worker, or otherwise enforce the redirect before asset handling.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

Comment on lines +97 to +100
for (const { name, value, reason } of check.expectedHeaders || []) {
const header = response.headers.get(name) || "";
if (!hasContent(header, value)) {
failures.push(reason || `missing ${name} header matching ${typeof value === "string" ? value : value.toString()}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Compare redirect Locations exactly

For the newly added redirect checks, string expectations are evaluated with includes, so an incorrect header such as https://seofixkit.com/check?utm_source=spot-check&unexpected=1 still passes even though the query was not preserved intact. Because Location has a single exact expected value here, compare it for equality rather than using the body-content matcher.

Useful? React with 👍 / 👎.

@nish3451
nish3451 merged commit c05fae5 into main Aug 9, 2026
2 checks passed
nish3451 added a commit that referenced this pull request Aug 14, 2026
)

The canonicalization item was already implemented by #70 (c05fae5) and
verified live; this report documents the verification for the lane record.

Co-authored-by: minimax-vps-lane1 <minimax-vps@nish.fleet>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
nish3451 pushed a commit that referenced this pull request Aug 15, 2026


Item 38147c59f9 (canonicalize www.seofixkit.com onto the apex host with
301 redirects and apex-only canonicals/sitemap) is already implemented,
tested, and live on origin/main. PR #70 (commit c05fae5, 2026-08-09)
shipped the 301 + apex-only canonicals/robots/sitemap/llms.txt, and this
worktree's worker-dispatch suite pins it (12/12 pass).

Re-verified independently today: live www.seofixkit.com root, deep path
with query, sitemap.xml, favicon.svg, and llms.txt all 301 to the apex;
apex sitemap/robots/canonicals are apex-only. No code change needed;
report only.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
nish3451 added a commit that referenced this pull request Aug 15, 2026
 (#153)

Item 38147c59f9 (canonicalize www.seofixkit.com onto the apex host with
301 redirects and apex-only canonicals/sitemap) is already implemented,
tested, and live on origin/main. PR #70 (commit c05fae5, 2026-08-09)
shipped the 301 + apex-only canonicals/robots/sitemap/llms.txt, and this
worktree's worker-dispatch suite pins it (12/12 pass).

Re-verified independently today: live www.seofixkit.com root, deep path
with query, sitemap.xml, favicon.svg, and llms.txt all 301 to the apex;
apex sitemap/robots/canonicals are apex-only. No code change needed;
report only.

Co-authored-by: fleet-dispatch <fleet-dispatch@local>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
nish3451 added a commit that referenced this pull request Aug 17, 2026
…21f0364 (#162)

Item 38147c59f9 (canonicalize www.seofixkit.com onto the apex host with
301 redirects and apex-only canonicals/sitemap) is already implemented,
tested, and live on origin/main. PR #70 (commit c05fae5, 2026-08-09)
shipped the 301 + apex-only canonicals/robots/sitemap/llms.txt; PR #107
(commit f5b2349) extended it to static assets via run_worker_first.

Re-verified today against origin/main at 21f0364: npm run
test:worker-dispatch passes 12/12 (covers www root, deep path with
query, /api/health, /sitemap.xml, asset layer /favicon.svg + /assets/*);
repo has no www serving URL anywhere outside the redirect logic, its
regression locks, the deliberate app-host allowlists, the wrangler
routes config, and the live spot-check script. Live spot checks:
www root, /packages?utm_source=scout, /sitemap.xml, /favicon.svg, and
/llms.txt all 301 to apex with path/query intact; apex sitemap/robots/
canonicals are apex-only. No code change needed; report only.

Co-authored-by: fleet-dispatch <fleet-dispatch@local>
nish3451 added a commit that referenced this pull request Aug 21, 2026
…7783adc (#171)

Item 38147c59f9 (canonicalize www.seofixkit.com onto the apex host with
301 redirects and apex-only canonicals/sitemap) is already implemented,
tested, and live on origin/main. PR #70 (commit c05fae5, 2026-08-09)
shipped the 301 + apex-only canonicals/robots/sitemap/llms.txt; #107
added run_worker_first so www static assets 301 too; #89 hardened the
live spot-check.

Re-verified today against origin/main at 7783adc: test:worker-dispatch
14/14, test:public-pages 15/15, test:promise-audit 71/71; live www root,
deep path with query, sitemap.xml, llms.txt, favicon.svg, well-known and
SPA-fallback paths all 301 to the apex with path/query intact; apex
sitemap/robots/canonicals are apex-only. No code change needed; report
only.

Co-authored-by: fleet-dispatch <fleet-dispatch@local>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
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