From 6dcfb673e5464c047cfa16f8a4fd44663b0c5cb1 Mon Sep 17 00:00:00 2001 From: aswathy-deriv Date: Tue, 27 Feb 2024 17:38:11 +0400 Subject: [PATCH] fix: redirection issue --- gatsby-node.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gatsby-node.js b/gatsby-node.js index 9611a724f77..9d034a13778 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -203,6 +203,21 @@ const BuildPage = (page, actions) => { isPermanent: true, }) } + if (is_academy) { + console.log('academy') + createRedirect({ + fromPath: `/academy-signup/`, + toPath: `/en/academy-signup/`, + redirectInBrowser: true, + isPermanent: true, + }) + createRedirect({ + fromPath: `/academy-signup`, + toPath: `/en/academy-signup`, + redirectInBrowser: true, + isPermanent: true, + }) + } const is_english = process.env.GATSBY_LANGUAGE === 'en' @@ -374,6 +389,13 @@ const BuildPage = (page, actions) => { }) } if (is_academy) { + console.log('academy') + createRedirect({ + fromPath: `/${lang}/academy-signup/`, + toPath: `/en/academy-signup/`, + redirectInBrowser: true, + isPermanent: true, + }) createRedirect({ fromPath: `/${lang}/academy-signup`, toPath: `/en/academy-signup`, @@ -381,6 +403,7 @@ const BuildPage = (page, actions) => { isPermanent: true, }) } + return current_page }) }