Skip to content

fix: 301 every www.seofixkit.com request onto the apex host - #89

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

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

Conversation

@nish3451

Copy link
Copy Markdown
Member

What

Completes the canonical-host item: every www.seofixkit.com request must 301-redirect onto the apex host with path+query intact, keeping canonicals/sitemap apex-only.

PR #70 covered worker-routed paths but left a gap: assets.run_worker_first was a path list, so static assets (/.well-known/*, security.txt, icons, /assets/*) and any SPA-fallback path were served 200 directly from www — verified live:

200 /security.txt
200 /.well-known/security.txt
200 /.well-known/skill.md
200 /.well-known/seofixkit.txt
200 /favicon.svg /og-image.svg /apple-touch-icon.svg /assets/waitlist-hero.jpg
200 /some-random-path-xyz          (SPA fallback)
301 /robots.txt /sitemap.xml /llms.txt /check   (worker-routed paths already ok)

Fix

  • wrangler.jsonc: "run_worker_first": true — every request hits the Worker first, so the www→apex 301 fires before any asset/SPA serving. Apex behavior unchanged: the Worker's ASSETS.fetch fallthrough still serves static assets and the SPA shell (same path /api/unknown-route uses today).
  • Config stays strict JSON (two in-repo parsers use JSON.parse on wrangler.jsonc).

Pins (regression-proof)

  • worker/index.test.mjs: www 301 pinned for /.well-known/security.txt, /assets/*, and arbitrary SPA-fallback paths.
  • scripts/live-promise-spot-check.mjs + test: two new live checks (www/.well-known/security.txt, www/unknown-spa-path) that fail the live promise audit if the deployed config regresses to a path list.
  • pages.test.mjs + promise-audit.test.mjs: accept run_worker_first: true or path array.
  • README Custom domain section documents the full-path guarantee.

Verification

  • npm run check: all suites pass (18 suites, 0 failures), build green.
  • wrangler deploy --dry-run (shielded scratch, per ERRORS.md due to the recurring zero-byte /home/nish/package.json): config accepted, run_worker_first: true validated, assets read (15 files).
  • Live pre-fix evidence above shows exactly the gap this closes.

@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 10, 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: 18 minutes

Limit details: You’ve used the included review currently available.

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 within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 9a8790be-84b1-439e-9c1d-7d18d18dbb1e

📥 Commits

Reviewing files that changed from the base of the PR and between 2da80ca and d0ce23a.

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

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

ℹ️ 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".

// `true` routes every request through the Worker (canonical-host redirect
// included); an array routes only the listed paths.
assert.equal(
runWorkerFirst === true || Array.isArray(runWorkerFirst),

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 Require run_worker_first to stay global

If run_worker_first is reverted to the pre-fix path array, this assertion still succeeds and every path checked below was already present in that array. The worker redirect tests call worker.fetch directly, bypassing Cloudflare asset routing, and the live spot-check is opt-in, so npm run check would not detect the recurrence of www static assets and SPA fallbacks being served directly. Assert that this value is true to pin the behavior this commit depends on.

Useful? React with 👍 / 👎.

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

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

… SPA-fallback paths

Rebased onto main. The config half of this branch (wrangler.jsonc
`run_worker_first: true` and the README canonical-host paragraph) has already
landed on main via a later PR, so what remains is the extra regression
coverage this branch adds on top of it:

- worker/index.test.mjs: fold `/.well-known/security.txt`,
  `/assets/waitlist-hero.jpg` and a SPA-fallback path
  (`/some-random-client-path`) into the existing www-redirect loop, so a
  regression to the `run_worker_first` path-array form fails loudly for
  well-known paths and client-routed paths, not just top-level assets.
- scripts/live-promise-spot-check.mjs: add live spot-checks for the same two
  new shapes (well-known path, SPA-fallback path) alongside the existing
  favicon check, and document why the static-asset check exists.
- scripts/live-promise-spot-check.test.mjs: pin the new spot-check paths and
  bump the expected result count 22 -> 24.

Conflict resolution kept main's landed side for wrangler.jsonc
(`not_found_handling: "404-page"` plus the run_worker_first comment), the
README paragraph, the stricter `run_worker_first: true` promise-audit
assertion, and the comment-stripping JSONC parser in pages.test.mjs -- this
branch's older versions of those would have reverted main or crashed on the
now-commented wrangler.jsonc.
@nish3451
nish3451 force-pushed the seo-fix-kit/lane1-www-canonicalize-all-paths branch from 3dfa275 to d0ce23a Compare August 19, 2026 07:47

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@nish3451
nish3451 merged commit 7c3bb63 into main Aug 19, 2026
2 checks passed
@nish3451
nish3451 deleted the seo-fix-kit/lane1-www-canonicalize-all-paths branch August 19, 2026 07:50
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