AI websites

Step-by-step tutorial

How to Fix an AI Website That Shows 404 After Deployment

Deployed your AI website but got a 404? Check the URL, deployment, build output, branch and domain in order before changing settings.

Product links on this page are ordinary official links. No affiliate commission is currently attached. Read our disclosure.

1. Quick answer

If your deployed site shows 404, check these in order:

  1. Are you opening the correct deployment URL?
  2. Did that deployment finish successfully?
  3. Was the expected page included in the build output?
  4. Are you checking the right branch and deployment?
  5. Does the custom domain point to the intended site?
  6. Is one page broken, or the whole site?

404 troubleshooting flow

URL → Deployment → Build → Branch → Domain

Stop at the first mismatch. Confirm it before changing anything.

A 404 means the requested page was not found. This guide focuses on static websites: finished page files served to visitors, using Cloudflare Pages as the example. Apps that generate pages on a server need additional checks.

Have ready: the failing address, your hosting project and the original website files. Hosting is the service that serves your site; a deployment is a version placed there.

2. First: check the exact URL

Symptom: a temporary address from an old message or bookmark returns 404.

What to check: open the intended deployment in your hosting project. Copy its displayed address instead of guessing it. Compare the project name and page path—the part after the domain.

What it means: a wrong project or an older version may not contain your page. An old address is not automatically broken.

Next: test the copied homepage address, then the failing page on that same address. Keep both results.

Our bounded example: during Just Make AI Work’s launch, a temporary URL was reported to return 404. We checked the deployment record and exact addresses; later checks returned the intended site successfully. Our records do not establish that the original URL was wrong or old, or identify its root cause. This case supports checking the address first, not one explanation for every 404.

3. Confirm the deployment succeeded

Symptom: the site is missing after you sent an update.

What to check: read the status and build log for that exact deployment. Cloudflare documents the log under deployment details. Check for successful publication, not just a started build.

What it means: failed or unfinished work does not establish that your new page is live. You may still be visiting another version.

Next: if running, wait for completion. If failed, ask your coding assistant to explain the first relevant error and propose one small fix. Remove secrets before sharing logs. Repeating deployment without changing the cause is not a diagnosis.

4. Check whether the page was actually built

Symptom: your website works locally but shows 404 online.

What to check: a build converts editable source into finished website files. The output folder holds those files. Ask your assistant:

Run the existing production build. Show whether it generated the homepage and the failing page. Compare its output folder with the hosting settings. Report missing files or mismatches; do not change settings yet.

What it means: a local preview can show content excluded from production. In this project, unpublished drafts are deliberately excluded. A missing draft is not a hosting failure.

Next: confirm the intended page is approved for publication and generated. Compare the build command, root and output directories with your actual project. Do not copy another project’s values.

For an Astro static site, routes are generated at build time; pages generated from a list need that list to include the intended address.

5. Check branch, preview and production

Symptom: the page exists in one preview but not at your public address.

What to check: your GitHub repository stores the project; a branch is a line of versions. A commit identifies a saved version. Compare the repository, branch and commit identifier with the deployment.

What it means: a preview can contain changes that production—the public version—does not. Cloudflare distinguishes individual deployment addresses from branch aliases. A branch alias moves to its latest deployment; an individual deployment address represents that version.

Next: confirm the configured production branch and automatic deployment setting. If the intended version never reached production, follow your approval process before publishing it. Do not publish unrelated drafts to fix one missing page.

6. Check the custom domain and redirects

Symptom: the host-provided address works, but your purchased domain fails.

What to check: compare the same page on both addresses. In the intended Pages project, inspect its custom-domain association and requested DNS target. DNS is the address-book system that directs a domain to a service.

What it means: the domain may lead elsewhere, or a redirect may send visitors to the wrong address. A 404 alone does not prove a DNS error.

Next: note the address before and after opening it. Ask your assistant to inspect any redirects and final destination. Pages supports redirect rules in a _redirects file; these do not apply to requests handled by Pages Functions, which run server-side code. Correct only a confirmed mismatch, preserving unrelated records and rules.

7. If only one route is 404

Symptom: the homepage works but one route, or page address, does not.

Check: paste the address directly, then follow the site’s own link. Compare spelling, capitalization, renamed paths and the generated files.

Meaning: the problem may be specific to that link or page. If navigation works but direct visits fail, ask whether the app handles routes in the browser; Pages has separate single-page-app behavior.

Next: fix the confirmed link or route. Do not add a catch-all redirect that hides missing pages by sending everyone home.

8. If the whole site is 404

Symptom: the homepage and known inner pages fail.

Check: return to the exact deployment URL, completion status and output folder. For a static Pages homepage, check for a top-level index.html; Cloudflare lists its absence as a possible root-address 404 cause.

Meaning: the served version or files need investigation before individual links.

Next: collect the failing addresses, time, deployment identifier and relevant log excerpt. If the output looks correct, ask hosting support to investigate. Do not invent a configuration fix.

9. What not to do first

Avoid changing several things at once.

  • Do not change DNS or clear all site caches before checking URL, version and files.
  • Do not rebuild from scratch or force-push repository history to guess at a fix.
  • Do not delete the Cloudflare project or create a second Pages project.

Running the existing build for diagnosis is fine.

10. Common causes at a glance

Possible cause Check before acting
Wrong or old URL Copy the intended deployment address.
Build failed or pending Read its status and log.
Wrong branch / version Compare branch and commit.
Missing page / files Inspect files and output folder.
Wrong domain target Compare with the working host address.
Bad redirect Check the final address and rule.

11. Next step

Success means the intended content appears at the intended address. Test the homepage, the repaired page directly and its navigation link. A successful response displaying the wrong page is not enough.

Use the safe update guide for an approved repair, the publishing guide for incomplete initial setup, or the hosting guide only if your project’s requirements do not fit its host.

Official documentation and project evidence checked October 13, 2026. The checks above are a troubleshooting sequence, not a diagnosis of your site.