You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc288ac
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: content/(serve)/routing.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@ There is no generic trailing-slash normalizer. The behavior comes from what the
209
209
210
210
| Situation | Behavior |
211
211
| --- | --- |
212
-
|`dir/index.html` exists |`/dir/` serves; `/dir`, `/dir/index` and `/dir/index.html`answer 308 to `/dir/`|
212
+
|`dir/index.html` exists |`/dir/` serves and `/dir` answers 308 to `/dir/`. With clean URLs on, `/dir/index` and `/dir/index.html`also redirect there|
213
213
| A directory listing exists for `dir`|`/dir/` serves, `/dir` answers 308 to `/dir/`|
214
214
| Clean URLs are on and `page.html` exists |`/page` serves; `/page/` and `/page.html` answer 308 to `/page`|
215
215
| Anything else | No normalization. The other spelling falls through to the SPA fallback or a 404 |
@@ -218,7 +218,7 @@ Those compiled 308s accept every method and carry the incoming query across.
218
218
219
219
## Index files and clean URLs
220
220
221
-
`index.html` at the root answers `/`. `docs/index.html` answers `/docs/`, and `/docs`, `/docs/index` and `/docs/index.html` redirect there with a 308. With clean URLs on, each page has one URL, as on Cloudflare Pages. A folder always serves its own `index.html`, the file every static site generator and framework writes for a folder.
221
+
`index.html` at the root answers `/`. `docs/index.html` answers `/docs/`, and `/docs` redirects there with a 308. With clean URLs on, `/docs/index` and `/docs/index.html` also redirect there. A folder always serves its own `index.html`, the file every static site generator and framework writes for a folder.
222
222
223
223
With no `index` set, Spacefast infers the homepage: a root `index.html`, else the file a 200 `fallback` names (unless the version runs a worker, which keeps `/`), else a single public HTML file, else the one root-level HTML file, else none, which puts the Space in files mode with directory listings.
224
224
@@ -233,7 +233,7 @@ Two keys in `sf.jsonc` change it:
233
233
234
234
`index` names the homepage, the file `/` serves. It doesn't rename folder indexes: with `"index": "home.html"`, `docs/home.html` doesn't answer `/docs/`, and the publish warns with `custom_index_not_folder_index`. Setting it to `false` serves no homepage.
235
235
236
-
`cleanUrls` serves a flat `about.html` at `/about`, and redirects `/about.html` and `/about/` there with a 308, query string included. A rewrite that lands on `/about.html` still serves the file, and a page you address with your own redirect or `_headers` rule keeps its `.html` URL. With `"cleanUrls": false`, pages answer only at their file URL. It defaults to on, with or without a fallback, so a committed page always wins its URL over the SPA shell.
236
+
`cleanUrls` serves a flat `about.html` at `/about`, and redirects `/about.html` and `/about/` there with a 308, query string included. A rewrite that lands on `/about.html` still serves the file, and a page you address with your own redirect or `_headers` rule keeps its `.html` URL. With `"cleanUrls": false`, flat pages answer only at their file URL. Folders still serve their `index.html` at the folder URL: `/docs/` serves and `/docs` redirects there. The literal `/docs/index.html` also serves, while `/docs/index` has no generated alias. `cleanUrls` defaults to on, with or without a fallback, so a committed page always wins its URL over the SPA shell.
237
237
238
238
In a config that declares `"version": 1`, these live under `serve` as `serve.index`, `serve.cleanUrls`, `serve.spaFallback`, and `serve.directoryListing`.
0 commit comments