The short answer
Cloudflare Pages handles .html automatically:
about.htmlis reachable at/about;/about.html308-redirects to/about;about/index.htmlis served at/about/;- root
index.htmlis/; .htmis not normalized.
So write extensionless, root-relative links in navigation, canonical tags, sitemaps and structured data. No configuration is required.
Recommended structure
/
├─ index.html → /
├─ about.html → /about
├─ products.html → /products
├─ blog/post.html → /blog/post
├─ 404.html
└─ assets/
├─ site.css
└─ site.jsLink rules
- Home:
/ - Pages:
/about,/contact,/blog/post - Directory pages:
/products/forproducts/index.html - Never link to
about.htmlor use../ - Keep canonical,
og:urland sitemap URLs identical to the visible link
Common mistakes
- Linking to
about.html: it works but adds a redirect and often breaks canonicals. - Mixed-case or spaced file names: Pages is case-sensitive.
- Missing root
index.html. - Building pages from query strings instead of separate HTML files.
- Adding an SPA fallback on a multi-page site: every path becomes the home page.
Checklist
- [ ] Root
index.html - [ ] One lowercase
.htmlfile per page - [ ] No
.htmlin internal links - [ ] canonical and sitemap match those links
- [ ]
404.htmlpresent - [ ] Assets referenced as
/assets/...
Copyable prompt
You are a front-end engineer. Build a static multi-page website for [brand / business] that can be uploaded directly to Cloudflare Pages.
Rules:
1. index.html at the root; one HTML file per page (about.html, products.html, contact.html); assets under assets/.
2. Every internal link must be a root-relative path without .html: /, /about, /products, /contact. Never link to about.html and never use ../.
3. canonical, og:url, sitemap.xml and JSON-LD URLs must match those extensionless paths.
4. File names use lowercase letters, digits and hyphens only.
5. No server-side routing, Node, database or build tool; HTML, CSS and vanilla JavaScript only.
6. Include 404.html. Do not add an SPA /* rewrite for a multi-page site.
7. Output the file list and the full content of every file; no ellipses.
8. Write the page copy in [language].About the author
Bweb Editorial TeamContent and editorial
Turning first-hand building, publishing, domain and acquisition work into steps readers can follow.
Reviewed by: SHUOFENG
Facts are checked by a person before publishing; AI only assists with drafts and translation.
Editorial standards