A single-page app shows "Not found" on refresh
My React, Vue or Svelte site works until I refresh on an inner page, then it says Not found.
Turn on Single-page app under Site settings so every address that is not a file is answered with index.html.
Before you start: A static site built from a single-page app.
Step by step
- Open your site from the client area and go to Site settings in the left menu.
- Under Site files, check that Folder to serve points at your build output. Vite and most Vue or Svelte projects write to dist; Create React App writes to build.
- Tick Single-page app. This tells CoreX to answer any address that is not a real file with your index.html, which is what client-side routers expect.
- Click Save changes, then restart the site with the Restart button at the top of the panel so the new setting is used.
- Open an inner page of your site, for example /dashboard, and refresh it: it now loads instead of showing Not found.
- Real files such as scripts, styles and images are still served as themselves, so nothing else about your site changes.
Check it worked: Inner pages load on refresh.
Why it happens: A single-page app handles its own addresses in the browser; the server has to hand it the same page for all of them.
More guides on Website hosting: