Routing
The site is served as plain static files. The server looks up a request path in this order.
Lookup order
Take /about as an example:
- Exact file: is there a file named
about(no extension) in the site root? .htmlfile: is there anabout.html?- Directory index: is there an
about/index.html? If so, the server responds with a 301 redirect to/about/. Query parameters are preserved. - Fallback: return 404, or the root
index.htmlif SPA fallback is enabled.
The home page / serves /index.html (or /index.htm) directly. A request that already ends with / (such as /about/) serves that directory's index.html without another redirect.
Examples
| Request | Files on the site | Result |
|---|---|---|
/ | index.html | 200, index.html |
/about | about.html | 200, about.html |
/about | about/index.html | 301 to /about/, then 200 |
/about/ | about/index.html | 200, about/index.html |
/about | both about.html and about/index.html | 200, about.html |
/docs/intro | docs/intro.html | 200 |
/docs/intro | docs/intro/index.html | 301 to /docs/intro/ |
/missing | none | 404, or the SPA fallback |
When both about.html and about/index.html exist, .html wins.
Directories are never listed. Static assets such as .js, .css, images and fonts are served from their exact path.
Next: Custom 404, Site config