# SPA mode

> What SPA mode does in the preview and on the published site, when to turn it on or off, and how links to other pages behave.
> Source: https://playcode.io/docs/classic/spa-mode - last reviewed 2026-10-09.
> Ask Playcode's agent: "Turn off SPA mode for this project." It switches SPA mode for this project; publish again for the live site to follow.

SPA mode serves `index.html` for every page address, so the router of a single-page app can show the right page. It is on by default. Turn it off for a site made of separate HTML files.

## On or off

| | SPA mode on, the default | SPA mode off |
|---|---|---|
| Use it for | React Router, Vue Router and other single-page apps | Sites made of separate HTML files, like `about.html` |
| Preview | Always runs `index.html` | Runs the file the address names. For `/about`, the first of `about`, `about.html` and `about/index.html` |
| Published site | A page address with no file of its own gets `index.html`. Files like images are served as they are | Each address needs its own file |

## Links to other pages, with SPA mode off

In the preview, `/about` also finds `about.html`. A published site does not. Link to `/about.html`, or put the page in `about/index.html` and link to `/about/`.

On your Playcode address, an address with no file shows your `404.html` if the site has one.

## Change it

1. Open the project menu and choose **Settings…**. Settings opens on the project's **General** page.
2. Under **Behavior**, turn **SPA mode** on or off: "Serve every route from index.html."
3. Publish again, so the published site follows.

The setting belongs to the project, and everyone who opens the project sees it.

## Messages

| Message | Fix |
|---|---|
| "SPA mode is enabled but /index.html not found." | Create `index.html`, or turn off SPA mode |
| "Entry point not found: /about" | With SPA mode off, the preview found no file for that address. Choose one of the files the message lists |
