Skip to content

vercel.json rewrites every route to /index.html on a static multi-page site #12

Closed

Description

@ephbaum

Describe the bug

`vercel.json` has a catch-all SPA rewrite:

```json
"rewrites": [
{ "source": "/(.*)", "destination": "/index.html" }
]
```

This site is a static multi-page Astro build that emits real per-route HTML (~215 pages) — not a single-page app. A catch-all rewrite to `/index.html` is the wrong behavior here.

Separately, the `www` → apex redirect is written as a literal path pattern (`"source": "www.ephbaum.dev/(.*)"`), which matches against the request path, not the hostname, so it likely never actually fires.

Expected behavior

No SPA rewrite. The `www` redirect should match on host (via `"has": [{ "type": "host", "value": "www.ephbaum.dev" }]`) so it actually triggers.

Additional context

Fixed in #9.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions