Skip to content

Commit 3c6b10b

Browse files
fix: correct root redirect when trailingSlash = false (#879)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent e99f0a0 commit 3c6b10b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helpers/redirects.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const generateLocaleRedirects = ({
1818
const redirects: NetlifyConfig['redirects'] = []
1919
// If the cookie is set, we need to redirect at the origin
2020
redirects.push({
21-
from: `${basePath}${trailingSlash ? '/' : ''}`,
21+
from: `${basePath}/`,
2222
to: HANDLER_FUNCTION_PATH,
2323
status: 200,
2424
force: true,
@@ -32,7 +32,7 @@ const generateLocaleRedirects = ({
3232
}
3333
redirects.push({
3434
from: `${basePath}/`,
35-
to: `${basePath}/${locale}/`,
35+
to: `${basePath}/${locale}${trailingSlash ? '/' : ''}`,
3636
status: 301,
3737
conditions: {
3838
Language: [locale],

0 commit comments

Comments
 (0)