First Cloudflare deploy checklist

Get a static site from a dist folder to a custom domain without the SPA fallback, the trailing-slash loop, or an empty #root. Print this beside wrangler.

Walk it in order. Do not attach the custom domain until workers.dev (or the preview host) serves the files you expect.

This is first host, not a WordPress exit. Cutover, redirects, and Row Level Security (RLS) live on the edge migration checklist.

flowchart LR
    D["Build dist"] --> W["wrangler deploy"]
    W --> P["Proof host"]
    P --> C["Custom domain"]
    C --> H["curl the HTML"]
Three cream cards labeled Deploy, Domain, and HTML connected by a dotted line on a sand field
Host means those three. A form backend is a later Worker.

wrangler.jsonc before the first upload

A marketing site that must rank is files in dist. It is not a Node origin. Copy the knobs, then change Your project name.

KnobSet thisIf you guess
assets.directory./dist after the Vite (or other) buildYou upload the repo root, or nothing useful
not_found_handling404-pagesingle-page-application returns index.html for junk URLs. Soft 404s. Thin pages.
html_handlingdrop-trailing-slashauto-trailing-slash 307s /blog/slug to /blog/slug/. Google skips indexing.
main / fetch handlerOmit it for a static assets WorkerYou debug a script that only needed to serve files
  • Worker name is Yours, not a tutorial leftover
  • dist/404.html exists before you set 404-page

Deploy and proof host

  • wrangler login on the account that will own the hostname
  • Production build writes into dist (or the directory you named)
  • wrangler deploy finishes without uploading source
  • name.workers.dev (or the Pages preview host) loads the site Proof only. Do not print workers.dev on a business card.
  • A junk path returns a real 404, not the homepage

Custom domain

Search “Cloudflare website URL” and you will mix three hostnames. The brand URL is the only one clients should see.

  • Custom domain attached on the Worker (or Pages project) to example.com or www
  • Apex and www agree. One redirects. Canonicals match.
  • If mail lives on cPanel, proxy only website hostnames. Mail Exchanger (MX) records stay DNS only.
  • HTTPS padlock on the custom domain, not only on workers.dev

Prove the HTML (the AdSense test)

Hosting does not fix an empty #root. Curl the custom domain with JavaScript off. You should read the article, not a chat widget and a title.

  • curl -s the homepage and one inner URL. Visible copy is in #root, not display:none or clip:rect
  • Title is complete (no truncated apostrophe from a regex scrape of source)
  • Request /path (no trailing slash). You are not bounced to /path/ and back
  • After this passes, keep the Cloudflare static website map for DNS, SSL, and _redirects. Do not mix both jobs on minute one.

Related guides