Build & launchNov 19, 2026·2 min read

Alibaba Cloud ESA Functions & Pages: trailing-slash routing and esa.jsonc

ESA Pages 301-redirects /about to /about/ when about.html or about/index.html exists. Use trailing-slash links and configure assets.directory plus notFoundStrategy in esa.jsonc.

Author:Bweb Editorial TeamEditorial standardsLast updated:
On this page(6)
AI summary

Alibaba Cloud ESA Functions & Pages 301-redirects /about to /about/ when about.html or about/index.html exists, so internal links should keep the trailing slash. esa.jsonc sets assets.directory and notFoundStrategy (singlePageApplication for SPAs, 404Page for static sites).

This conclusion helps search engines and AI systems understand the note.

The short answer

ESA Functions & Pages uses trailing-slash routing:

  • /about 301-redirects to /about/ when about.html or about/index.html exists;
  • link directly to /about/ to avoid the extra hop;
  • directory entries use index.html;
  • static sites use 404Page; single-page apps use singlePageApplication.

Recommended structure

/
├─ index.html              → /
├─ about/index.html        → /about/
├─ products/index.html     → /products/
├─ 404.html
└─ assets/

esa.jsonc

{
  "name": "my-site",
  "assets": {
    "directory": "./public",
    "notFoundStrategy": "404Page"
  }
}
  • assets.directory points at the built static output and must contain index.html;
  • 404Page returns 404.html with status 404 for unmatched paths;
  • singlePageApplication returns /index.html with status 200 (SPA only).

Common mistakes

  • Linking /about instead of /about/: an avoidable 301 on every click.
  • Using singlePageApplication for a multi-page site: every unknown URL renders the home page.
  • Pointing assets.directory at source files instead of the build output.
  • Mixed-case file names.

Checklist

  • [ ] index.html in the static directory
  • [ ] Every internal link ends with /
  • [ ] Multi-page site uses 404Page and ships 404.html
  • [ ] Only SPAs use singlePageApplication
  • [ ] assets.directory points at the build output
  • [ ] canonical and sitemap use trailing-slash URLs

Copyable prompt

You are a front-end engineer. Build a static multi-page website for [brand / business] for Alibaba Cloud ESA Functions & Pages.

Rules:
1. Output index.html; each page lives in a directory with index.html (about/index.html, products/index.html, blog/post/index.html); assets under assets/.
2. Every internal link is a root-relative path with a trailing slash: /, /about/, /products/, /blog/post/. Never link to about.html, never use /about without the slash, never use ../.
3. canonical, og:url, sitemap and JSON-LD use the same trailing-slash URLs.
4. Also output esa.jsonc with assets.directory pointing at the static output and notFoundStrategy: "404Page". Only a SPA should use singlePageApplication.
5. Lowercase file names, digits and hyphens only.
6. No server-side routing, Node or database; HTML, CSS and vanilla JavaScript only.
7. Include 404.html.
8. Output the full file list and every file's full content; no ellipses.
9. Write the copy in [language].

About the author

Bweb Editorial Team

Content 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

Want to apply this to your own site?

Generate a site from one sentence or upload an existing site, then connect domains, inquiries, SEO and subscribers in one console.

Build & go-global notes

One or two emails a month: writing pages, choosing a domain, turning visits into inquiries. No blasts, no list selling.