The current documentation for vercel.json redirects uses the /:path* pattern in examples, but this pattern does not match the root path / due to how the wildcard matching works.
Technical Detail:
The /:path* pattern translates to a regex pattern where at least one character is required after the /. The * quantifier (0 or more) applies to the path variable itself, not what comes after the /. This means:
/alone will not match/anythingwill match- Empty path will match only if the entire pattern is optional
Current Behavior:
When users implement a redirect using /:path*, requests to the root path / are not redirected as expected. They receive a 200 response instead of being redirected to the destination.
Recommended Fix:
To match all paths including the root, use one of these approaches:
- Split patterns (recommended):
{ "redirects": [ { "source": "/", "destination": "https://www.example.com/" }, { "source": "/:path*", "destination": "https://www.example.com/:path*" } ]}- Use regex
/(.*)
Documentation Improvement:
Add a note clarifying that /:path* does not match the root path /, and provide examples showing how to handle root path redirects when necessary.