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
Copy file name to clipboardExpand all lines: documentation/docs/13-configuration.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@ const config = {
42
42
router:true,
43
43
ssr:true,
44
44
target:null,
45
+
trailingSlash:'never',
45
46
vite: () => ({})
46
47
},
47
48
@@ -138,6 +139,16 @@ Enables or disables [server-side rendering](#ssr-and-javascript-ssr) app-wide.
138
139
139
140
Specifies an element to mount the app to. It must be a DOM selector that identifies an element that exists in your template file. If unspecified, the app will be mounted to `document.body`.
140
141
142
+
### trailingSlash
143
+
144
+
Whether to remove, append, or ignore trailing slashes when resolving URLs to routes.
145
+
146
+
-`"never"` — redirect `/x/` to `/x`
147
+
-`"always"` — redirect `/x` to `/x/`
148
+
-`"ignore"` — don't automatically add or remove trailing slashes. `/x` and `/x/` will be treated equivalently
149
+
150
+
> Ignoring trailing slashes is not recommended — the semantics of relative paths differ between the two cases (`./y` from `/x` is `/y`, but from `/x/` is `/x/y`), and `/x` and `/x/` are treated as separate URLs which is harmful to SEO. If you use this option, ensure that you implement logic for conditionally adding or removing trailing slashes from `request.path` inside your [`handle`](#hooks-handle) function.
151
+
141
152
### vite
142
153
143
154
A [Vite config object](https://vitejs.dev/config), or a function that returns one. Not all configuration options can be set, since SvelteKit depends on certain values being configured internally.
0 commit comments