Hey everyone,
I’m currently building a Single Page Application (SPA) in WeWeb and hosting it on Vercel via manual export or GitHub deployment.
I’m running into a common but annoying issue, and I’m curious to hear how others have solved this.
The problem:
If I visit a deep link directly in the browser like:
https://****.com/de/project/36edf46e-d554-41b7-8449-3a0f06b9fb99/tasks
… I end up on a 404 page or get redirected to the homepage (/en/), instead of seeing the actual project page.
I understand this is expected behavior with SPAs:
The server doesn’t know how to handle the route and must redirect everything to index.html.
So I added the standard Vercel SPA rewrite config:
// vercel.json
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"rewrites": [
{ "source": "/(.*)", "destination": "/" }
]
}
This correctly loads my SPA when hitting unknown routes. But it always lands me on /de/ (the app start page), and I lose the original route (/project/:id/tasks)
WeWeb generates a flat folder with this minimal index.html at the root:
<!DOCTYPE html>
<html>
<head>
<script>
window.location.href = "/en/"
</script>
</head>
</html>
This means that every route gets forcibly redirected to /en/, and the dynamic path is lost.
The internal router (presumably Vue-based) inside WeWeb can’t “rehydrate” the original path unless it’s preserved manually.
I would love to know:
-
How do others deal with this situation when using WeWeb exports + Vercel (or Netlify)?
-
Is there a clean WeWeb-native way to preserve the dynamic route?
-
Does WeWeb plan to offer better support for SPA-friendly exports without hardcoded redirects?
Would appreciate any experience, guidance, or links you can share. I feel like this must be a common situation for anyone self-hosting a WeWeb SPA.
Cheers,
Fynn