Skip to content

fix: every page lives at its address with no trailing slash - #281

Merged
kinqsradio merged 1 commit into
mainfrom
fix/slashless-urls
Nov 11, 2026
Merged

kinqsradio merged 1 commit into
mainfrom
fix/slashless-urls

Conversation

@kinqsradio

Copy link
Copy Markdown
Member

Change

Products Research asked for every page to be slashless, as the designs show. This extends #280 from the Planner page to all of them.

  • Addresses: the canonical address and every internal link are /apps, /pricing, /security, /download, /planner, /notes, /studio and /engineering. The home page stays /.
  • nginx: the slash form of each page answers 301 to the slashless one (one location ~ rule in nginx.conf). The slashless form is served as before.
  • Cloudflare Workers: html_handling is now drop-trailing-slash, which does the same natively. Workers answers the slash form with its own 307, not 301.
  • Fix for fix: the Planner landing page lives at exactly /planner #280: I removed site/public/_redirects. With auto-trailing-slash it made /planner redirect to /planner/ and the rule redirect back, forever. I reproduced the loop in Cloudflare's local runtime on current main (8 redirects, no answer). The live site runs on nginx, so it never saw this. The Dockerfile no longer needs to delete the file.
  • The dev server (scripts/serve-site.mjs) follows the same rule.

Checks

  • node scripts/build-site.mjs --check; no internal link in the built pages ends in a slash, and all nine canonical addresses are slashless.
  • nginx, in a real container built from deploy/Dockerfile:
    • Slashless pages return 200, and all eight slash forms return one 301 to the slashless address.
    • /booking, /booking/ and unknown paths return 404; /_headers, /_redirects and /assets/ return 404.
    • Previews and /healthz still return 200, and the Content-Security-Policy is intact.
  • Cloudflare Workers, in wrangler dev --local (wrangler 4.160.0): every slashless page returns 200 and its slash form redirects once (307); following /planner/ takes 1 hop. No loop.
  • Dev server: same behaviour as nginx.

Risk and undo

  • Links others have saved with a trailing slash still work through the redirect.
  • Revert the PR to undo. Reverting only the config would bring back the Workers loop.

AI usage

Claude Code with Claude Sonnet 5.5 (claude-sonnet-5-5). No external sources.

Canonical addresses and internal links are /apps, /pricing, /security,
/download, /planner, /notes, /studio and /engineering, as in the designs.
The trailing-slash form redirects: a location rule in nginx.conf, and
drop-trailing-slash in wrangler.jsonc. The _redirects file from the Planner
change is removed: with auto-trailing-slash it made /planner redirect to
/planner/ and back forever on Workers.
@kinqsradio
kinqsradio merged commit 46313a4 into main Nov 11, 2026
8 checks passed
@kinqsradio
kinqsradio deleted the fix/slashless-urls branch November 11, 2026 01:50
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