# AWS Amplify 404 Not Found

> Fix a 404 on an AWS Amplify Hosting site: add the SPA rewrite rule, order redirects correctly, check wildcard syntax and confirm the build output folder.

Canonical: https://scaplet.com/errors/cdn/amplify-404

Guide Error · CDN and hosting errors

Fix a 404 on an AWS Amplify Hosting site: add the SPA rewrite rule, order redirects correctly, check wildcard syntax and confirm the build output folder.

4 min

read

5

sources

Nov 1, 2026

updated

Scaplet Editorial Team

author

In one line

On AWS Amplify Hosting a 404 usually means the requested path has no file and no rewrite rule sends it elsewhere. Single page apps need a 200 rewrite to `/index.html`, redirects are applied top to bottom, a rule with a bad wildcard is ignored, and a wrong `baseDirectory` in the build settings breaks routes. Check each in that order.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Famplify-404%20(%22AWS%20Amplify%20404%20Not%20Found%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Famplify-404%20(%22AWS%20Amplify%20404%20Not%20Found%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Famplify-404%20(%22AWS%20Amplify%20404%20Not%20Found%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Famplify-404%20(%22AWS%20Amplify%20404%20Not%20Found%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 4 minutes.

1. [Why Amplify returns a 404 01](#why-amplify-returns-a-404)
2. [The single page app rewrite 02](#the-single-page-app-rewrite)
3. [Check the build output folder 03](#check-the-build-output-folder)
4. [Debug it in five steps 04](#debug-it-in-five-steps)
5. [SEO and crawler notes 05](#seo-and-crawler-notes)

_01_Causes and where Amplify documents them

## Why Amplify returns a 404

Amplify Hosting serves files from your build output and applies your redirect and rewrite rules from the console. A 404 means a request matched no file and no rule. The docs describe a 404 redirect as occurring "when a request points to an address that doesn't exist", and the destination page is shown instead of the requested one.

Symptom

### Deep links to `/dashboard` fail, home page works

Likely cause

Single page app without a rewrite to `/index.html`

Fix

Add the SPA 200 rewrite below

Symptom

### A specific redirect never fires

Likely cause

A broader rule above it matches first

Fix

Move the specific rule to the top; rules apply top down

Symptom

### A redirect with `<*>` is ignored

Likely cause

Wildcard not at the end, or used twice

Fix

Use one `<*>`, at the end of the source

Symptom

### Rule for `https://example.com/path` does nothing

Likely cause

Domain rules cannot include a path component

Fix

Use a path-only rule, or a domain-only rule

Symptom

### Access denied or 404 on some routes with the SPA rule

Likely cause

`baseDirectory` does not match the build output folder

Fix

Point it at the folder your build writes

Symptom

### Unexpected 302 responses

Likely cause

Changed redirect or custom header config

Fix

Check custom headers and re-enable the default 404 rewrite rule

_02_Check it

## The single page app rewrite

Most SPA frameworks use `history.pushState()` to change the URL without a server request. That works for users who start at the root or `/index.html`, and "fails for users who navigate directly to any other page". The docs fix this with a 200 rewrite of everything except static file extensions.

A status of 200 makes this a rewrite: the content is served as if it came from the original address and the browser bar keeps the original URL. That is different from a 301, where the address changes. Because file extensions are excluded, a missing `.js` or `.png` still returns a real 404, which is what you want when debugging.

**Order matters**Redirects are applied from the top of the list down. Put narrow rules such as `/docs/specific-filename.html` above broad ones such as `/docs/<*>`, or the narrow rule is never reached.

Amplify console JSON editor: SPA rewrite (from the AWS docs)

```
[ { "source": "</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|woff2|ttf|map|json|webp)$)([^.]+$)/>", "status": "200", "target": "/index.html", "condition": null } ]
```

_03_Explained

## Check the build output folder

amplify.yml: baseDirectory must match your build folder

```
version: 1 frontend: phases: build: commands: - npm run build artifacts: baseDirectory: build files: - "**/*"
```

The Amplify docs say that if you get access denied for certain routes with an SPA rule, "the baseDirectory might not be set correctly". If your frontend builds to `build`, the settings must point to `build`. Amplify can store build settings in the console or in an `amplify.yml` in your repository, and the repository file wins for the branches that have it.

_04_How it works

## Debug it in five steps

1. 01

### Request the exact path

Run `curl -sI https://main.d1234example.amplifyapp.com/dashboard` and look at the status. A 404 on a route and a 200 on `/` confirms a missing rewrite.
2. 02

### Open the rules

In the Amplify console, open your app and its redirects and rewrites settings, then read the list top to bottom.
3. 03

### Look for ignored rules

Rules with more than one `<*>`, a `<*>` that is not last, or a domain plus a path in the source are ignored without an error.
4. 04

### Check trailing slashes

Amplify adds a [trailing slash](/glossary/trailing-slash) when needed for clean URLs: `/about.html` is served as `/about` when `about.html` returns 404, and `/about/` serves `/about/index.html`.
5. 05

### Redeploy and retest

After changing build settings, run a new build and request the failing path again.

_05_Explained

## SEO and crawler notes

A catch-all 200 rewrite means every unknown URL returns your app shell with a 200. Google says that when a 2xx page "suggests an error ... an empty page or an error message, [Search Console](/glossary/google-search-console) will show a [soft 404 error](/glossary/soft-404)". If your SPA renders a not-found view, serve a real 404 for those paths with a rule of type 404 to a `/404.html`, and keep valid routes on the 200 rewrite. For the general meaning see [404 Not Found](/errors/http/404).

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- amazon.com
- google.com

1. 01 [Setting up redirects and rewrites for an Amplify application](https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html) docs.aws.amazon.com · checked 2026-11-01
2. 02 [Redirects and rewrites example reference](https://docs.aws.amazon.com/amplify/latest/userguide/redirect-rewrite-examples.html) docs.aws.amazon.com · checked 2026-11-01
3. 03 [Troubleshooting redirects and rewrites](https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-redirects.html) docs.aws.amazon.com · checked 2026-11-01
4. 04 [Configuring the build settings for an Amplify application](https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html) docs.aws.amazon.com · checked 2026-11-01
5. 05 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-11-01

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ How do I fix 404 on refresh in an Amplify React app?

Add a 200 rewrite that sends all non-file paths to `/index.html`, using the regex from the Amplify redirect examples. Put it in the redirects and rewrites settings and redeploy if needed.

_02_ Why is my Amplify redirect ignored?

Amplify applies rules top to bottom, ignores sources with more than one `<*>` or a misplaced one, and ignores domain rules that contain a path. Reorder and simplify the rule.

_03_ Is a 404 rewrite the same as a 404 status?

No. Amplify lists a 404 redirect type that shows a destination page for missing addresses, and a 200 rewrite that serves another page as if it were the original. Choose based on whether crawlers should see an error.

## Keep learning

[All errors](/errors)

[Learn CloudFront 404 Not Found CDN and hosting errors](/errors/cdn/cloudfront-404) [Related 4xx errors Status codes and links](/seo-issues/4xx-errors) [Read next Firebase Hosting 404 CDN and hosting errors](/errors/cdn/firebase-hosting-404) [Do Run a free site audit Free, about two minutes](/site-audit)

Other 404 errors
[404 Not Found in WordPress](/errors/http/404/wordpress) [404 Not Found on Apache](/errors/http/404/apache) [404 Not Found on nginx](/errors/http/404/nginx) [Cloudflare Pages 404 Not Found](/errors/cdn/cloudflare-pages-404) [CloudFront 404 Not Found](/errors/cdn/cloudfront-404)

More in CDN and hosting errors
[Vercel 429: Too Many Requests](/errors/cdn/vercel-429) [Vercel 500: Internal Server Error](/errors/cdn/vercel-500) [Vercel build failed](/errors/cdn/vercel-build-failed) [Vercel domain not working](/errors/cdn/vercel-domain-not-working) [Vercel FUNCTION_INVOCATION_TIMEOUT](/errors/cdn/vercel-function-invocation-timeout) [Vercel: too many redirects](/errors/cdn/vercel-too-many-redirects) [Akamai reference number](/errors/cdn/akamai-reference-number) [ALB 503 Service Unavailable](/errors/cdn/alb-503) [ALB 504 Gateway Timeout](/errors/cdn/alb-504-gateway-timeout) [API Gateway 403 Forbidden](/errors/cdn/api-gateway-403-forbidden) [API Gateway 504 Gateway Timeout](/errors/cdn/api-gateway-504) [AWS 502 Bad Gateway](/errors/cdn/aws-502-bad-gateway) [AWS Amplify 404 Not Found](/errors/cdn/amplify-404) [AWS EC2: Connection timed out](/errors/cdn/aws-ec2-connection-timed-out) [AWS Lambda 502 Bad Gateway](/errors/cdn/aws-lambda-502) [AWS Lambda timeout](/errors/cdn/lambda-timeout) [Azure Front Door 502](/errors/cdn/azure-front-door-502) [Cloud Run 503 error](/errors/cdn/cloud-run-503) [Cloudflare 504 Gateway Timeout](/errors/cdn/cloudflare-504) [Cloudflare Pages 404 Not Found](/errors/cdn/cloudflare-pages-404) [Cloudflare too many redirects (ERR_TOO_MANY_REDIRECTS)](/errors/cdn/cloudflare-too-many-redirects) [Cloudflare verify you are human loop](/errors/cdn/cloudflare-verify-you-are-human-loop) [CloudFront 400: Bad Request](/errors/cdn/cloudfront-400) [CloudFront 404 Not Found](/errors/cdn/cloudfront-404)

Terms on this page
[Trailing slash in URLs](/glossary/trailing-slash) [Google Search Console](/glossary/google-search-console) [Soft 404](/glossary/soft-404)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
