# 404 Not Found when I refresh a React page.

URL: https://antideploy.com/blog/404-not-found-when-i-refresh-a-react-page

A single-page app changes the address in the browser without asking the server. On refresh, the server must return index.html.

**What you see**

```
404 Not Found
```

## At a glance

- **What it means**: The server has no file for the route
- **On Antideploy**: Paths without an extension get index.html
- **Still 404**: Check for a dot, or your own server
- **Missing assets**: A file with an extension is a real 404

Published 7 October 2026. Facts checked 7 October 2026. 1 min read.

## What it means

In a single-page app, a router such as React Router changes the address without asking the server. If you open `/dashboard` directly, or refresh on it, the browser asks the server for a file called `dashboard`. There is none. The server has to return `index.html` and let your app take over.

## What Antideploy does

The server that hosts a static site or a built single-page app returns `index.html` for any address that has no file extension. A route such as `/dashboard` loads your app, and its router takes over. A missing file with an extension, such as a missing `logo.png`, returns a real 404. If your project has a `404.html`, that page is shown for those.

## If you still get a 404

- **The route has a dot in it.** A path such as `/reports/v1.2` looks like a file because of the `.2`. Avoid dots in route paths.
- **Your project is an app with its own server.** Then your server decides. Make it return `index.html` for routes it does not know.
- **You use a Dockerfile with a web server.** If your Dockerfile runs a web server such as nginx, its configuration decides. Add a rule that falls back to `index.html`.
- **A wrong base path.** If your app is built to live under a folder, assets and links break. Set the base path to `/`, for example `base: "/"` in a Vite config.

## Routing questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto:support@antideploy.com)

### Do I need a _redirects file or a rewrite rule?

Not on Antideploy's static hosting. The fallback to `index.html` is built in.

### Does Next.js need this?

No. A Next.js app runs its own server and handles its routes.

### Does this error cost anything?

No. It is a page in your app, and a deploy is not involved.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [How to deploy a Vite React app](https://antideploy.com/blog/how-to-deploy-a-vite-react-app): A Vite app deploys as a free static site. The build, the dist folder, routing and variables.
- [How to deploy a static website for free](https://antideploy.com/blog/how-to-deploy-a-static-website-for-free): Plain HTML or a built frontend. Unlimited, free on every plan, with HTTPS and no card.
- [Module not found: Can't resolve](https://antideploy.com/blog/module-not-found-cant-resolve): The build cannot find an import. Match capital letters exactly, add the package, or commit the file.

- [Static sites](https://antideploy.com/platform/static-sites)
- [Deployments](https://antideploy.com/platform/deployments)
- [Hosting](https://antideploy.com/platform/hosting)

Facts on this page were checked against the live platform on 7 October 2026.

## Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
