CoreX Hosting

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

  1. Open your site from the client area and go to Site settings in the left menu.
  2. 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.
  3. 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.
  4. Click Save changes, then restart the site with the Restart button at the top of the panel so the new setting is used.
  5. Open an inner page of your site, for example /dashboard, and refresh it: it now loads instead of showing Not found.
  6. 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: