From c3ccffc198bc2b766c73b6471de1ea1da41a03c4 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Fri, 3 Dec 2021 16:24:31 +0000 Subject: [PATCH] fix: correct root redirect when trailingSlash = false --- src/helpers/redirects.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/redirects.ts b/src/helpers/redirects.ts index 2e0020707d..987063ac2b 100644 --- a/src/helpers/redirects.ts +++ b/src/helpers/redirects.ts @@ -18,7 +18,7 @@ const generateLocaleRedirects = ({ const redirects: NetlifyConfig['redirects'] = [] // If the cookie is set, we need to redirect at the origin redirects.push({ - from: `${basePath}${trailingSlash ? '/' : ''}`, + from: `${basePath}/`, to: HANDLER_FUNCTION_PATH, status: 200, force: true, @@ -32,7 +32,7 @@ const generateLocaleRedirects = ({ } redirects.push({ from: `${basePath}/`, - to: `${basePath}/${locale}/`, + to: `${basePath}/${locale}${trailingSlash ? '/' : ''}`, status: 301, conditions: { Language: [locale],