Skip to content

feat: redirect vite.plus vanity domain to installer scripts#30

Merged
fengmk2 merged 1 commit into
mainfrom
redirect-vite-plus-domain
Jun 3, 2026
Merged

feat: redirect vite.plus vanity domain to installer scripts#30
fengmk2 merged 1 commit into
mainfrom
redirect-vite-plus-domain

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Jun 3, 2026

What

The vite.plus apex domain now points at this Worker. This adds a host-based redirect so the short domain works as an installer entry point:

Request Result
https://vite.plus 302 -> https://viteplus.dev/install.sh
https://vite.plus/ps1 302 -> https://viteplus.dev/install.ps1

So curl https://vite.plus | sh and irm https://vite.plus/ps1 | iex both work.

How

New middleware middleware/02.redirect-vite-plus.ts, mirroring the existing 01.redirect-to-custom-domain.ts pattern with an extracted, unit-tested buildViteplusRedirect() helper.

  • Only the vite.plus apex host is matched. The canonical setup.viteplus.dev host, the legacy vp-setup.void.app host, and localhost (dev) fall through untouched, so the download page and existing legacy redirect keep working.
  • www.vite.plus is intentionally not matched (only the apex was requested).
  • Any path other than /ps1 defaults to install.sh; a trailing slash on /ps1 is tolerated.

Tests

Adds tests/redirect-vite-plus.test.ts (9 cases): both redirect rules, trailing slash, arbitrary paths, query strings, and the null/fall-through cases for other hosts and a missing host header. vp check and vp test (31 tests) pass.

Note for deploy

For these redirects to fire, vite.plus must be attached as a custom domain/route on the deployed Worker, not just pointed via DNS. Once requests reach the Worker with Host: vite.plus, the redirect applies.

Point the newly-attached vite.plus apex domain at the Vite+ install
scripts so `curl https://vite.plus | sh` and `irm https://vite.plus/ps1
| iex` work as install entry points:

  https://vite.plus     -> 302 https://viteplus.dev/install.sh
  https://vite.plus/ps1 -> 302 https://viteplus.dev/install.ps1

Implemented as a host-based middleware mirroring the existing
01.redirect-to-custom-domain pattern. Only the vite.plus apex host is
matched; the canonical setup host, the legacy host, and localhost fall
through untouched. Any non-/ps1 path defaults to install.sh.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

✅ Staging deployment successful!

Preview: https://vp-setup-staging.void.app/
Commit: 4d4d278

@fengmk2 fengmk2 merged commit 70d8cc0 into main Jun 3, 2026
4 checks passed
@fengmk2 fengmk2 deleted the redirect-vite-plus-domain branch June 3, 2026 03:05
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.

2 participants