Routing

Single Page Applications

Edit this page

When deploying applications that use a client side router that does not rely on Server Side Rendering handle redirects to the index page so that loading from other URLs does not cause the CDN or Hosting to return not found for pages that are not actually there.

Each provider has a different way of doing this. For example on Netlify a _redirects file is created that contains:

/* /index.html 200

On Vercel you add a rewrites section to your vercel.json:

{
"rewrites": [
{
"source": "/(.*)",
"destination": "/index.html"
}
]
}
Report an issue with this page