Clean URLs
Point your server at extensionless URLs so
/about resolves to /about.html.
Sparke just fetch()es whatever URL you link to. For
extensionless URLs like /about, your
server must resolve them to
/about.html, or the browser fallback would 404. This
is a one-time server config.
Server config
nginxnginx
location / { try_files $uri $uri.html $uri/ =404; }
Caddynginx
try_files {{path}} {{path}}.html {{path}}/
Apache (.htaccess)apache
# simplest:
Options +MultiViews
Static hosts
-
Netlify serves
about.htmlat/aboutby default. -
Vercel: set
"cleanUrls": true. -
GitHub Pages has no rewrites – use folder pages
(
about/index.html).
For local development of the project's demo, the included
serve.py does the same extensionless fallback.
(This site uses folder pages, so it runs anywhere.)