Skip to content

cheerpj: old docs paths redirect, and labs' CheerpJ redirects are direct 301s - #503

Merged
sderossi merged 4 commits into
mainfrom
cheerpj/docs-redirects
Nov 2, 2026
Merged

sderossi merged 4 commits into
mainfrom
cheerpj/docs-redirects

Conversation

@sderossi

@sderossi sderossi commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Old CheerpJ docs paths that still 404, and CheerpJ redirects on labs.leaningtech.com that answer 302 (Cloudflare's default when a rule has no status) or take several hops.

Docs project (sites/cheerpj/public/_redirects, served at cheerpj.com/docs)

Each rule is written with and without /docs, as the file's other rules are.

  • guides/Implementing-Java-native-methods-in-JavaScript → guides/implementing-native-methods. 12+ GitHub repos link the old path.
  • guides/File-System-support and .html → guides/filesystem.
  • getting-started/java-app.html → getting-started/Java-app. HubSpot shows it as a visitor's first page.
  • guides/limitations → https://cheerpj.com/compatibility/. That page covers what doesn't run: pre-built native binaries, JavaFX and SWT, plus the supported Java versions, browsers and networking. The target is absolute because cheerpj.com's proxy would add /docs to a root-relative one.

labs.leaningtech.com (sites/labs/public/_redirects)

  • Status codes: every CheerpJ rule now has a 301. They had no status, so they were 302s. Rules for CheerpX, Cheerp and Flash are unchanged.
  • Fewer hops: /cheerpj, /cheerpj3/download(s), /cheerpj3/releases, /cheerpj3/examples/* and cheerpjAddStringFile go straight to cheerpj.com. The CheerpJ 2 Applet Runner links go to cheerpj.com, not through leaningtech.com.
  • Broken chains: /cheerpj3/guides/Implementing-Java-native-methods-in-JavaScript and /cheerpj3/guides/File-System-support ended in a 404. They now go to the current pages in one hop.
  • Showcase: /showcase/cheerpj (and /) → /showcase?product=CheerpJ. The old path still ranks in search.

Every target was checked live and answers 200.

Rule order

Cloudflare's docs say static redirects should come before dynamic ones (splats and placeholders), and that the top-most matching rule wins. Both _redirects files now list every static rule first and the splat rules last. A comment at the top of each file says so. No path changes target because of the move: no splat rule that used to come first matched any of the static rules moved above it.

The merge with main keeps its new / and /docs/ → overview redirects. Because of them, /ja, /zh and their /docs/ forms (with or without a trailing slash) now go straight to the overview instead of going through the docs root.

Trailing slashes and case

  • Every old path also has a rule with a trailing slash. The old pages are gone, so Cloudflare no longer turns …/File-System-support/ into …/File-System-support, and the slashed form used to 404.
  • Lowercase getting-started/java-app (with or without a slash) → getting-started/Java-app. On the preview, rule matching was case-sensitive: /docs/GUIDES/limitations 404s instead of matching. So this rule can't catch Java-app and loop.

After deploy

These should answer 301:

  • https://cheerpj.com/docs/guides/Implementing-Java-native-methods-in-JavaScript
  • https://labs.leaningtech.com/cheerpj3/guides/Implementing-Java-native-methods-in-JavaScript, in one hop
  • https://labs.leaningtech.com/showcase/cheerpj
  • https://cheerpj.com/docs/guides/limitations, to https://cheerpj.com/compatibility/

Related: leaningtech/leaningtech.com#225 (cheerpj.com's own redirects).

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Deploying labs-cheerpj-previews with  Cloudflare Pages  Cloudflare Pages

Latest commit: f2115c4
Status: ✅  Deploy successful!
Preview URL: https://6ba4fc46.labs-cheerpj-previews.pages.dev
Branch Preview URL: https://cheerpj-docs-redirects.labs-cheerpj-previews.pages.dev

View logs

@sderossi
sderossi marked this pull request as ready for review November 1, 2026 21:15
sderossi and others added 2 commits November 2, 2026 09:14
…ic ones

Keeps both sides of the conflict in sites/cheerpj/public/_redirects (the
docs-root redirect to /overview from main, the old English paths from this
branch). Following Cloudflare's guidance, both _redirects files now list every
static rule before the splat rules. The old /ja and /zh roots go straight to
the overview, so they skip a hop through the docs root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…case java-app redirects to Java-app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sderossi
sderossi merged commit 9911264 into main Nov 2, 2026
4 checks passed
@sderossi
sderossi deleted the cheerpj/docs-redirects branch November 2, 2026 09:24
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