From 18372e8d48398123f798b453ab66e65e1c7711e7 Mon Sep 17 00:00:00 2001 From: Alexander Lebedev Date: Mon, 17 Jul 2023 15:14:10 +0200 Subject: [PATCH] Redirect /new-member page without campaign code (#2797) ## Describe your changes Redirect new-member page without code to products page ## Justify why they are needed Continue draining traffic from old site ## Checklist before requesting a review - [x] I have performed a self-review of my code --- apps/store/next.config.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/store/next.config.js b/apps/store/next.config.js index b109b5ccf9..d1980c961b 100644 --- a/apps/store/next.config.js +++ b/apps/store/next.config.js @@ -110,19 +110,20 @@ module.exports = withBundleAnalyzer({ locale: false, })), ] - const oldSiteCampaigns = + const oldSiteRedirects = process.env.FEATURE_OLD_SITE_REDIRECTS === 'true' ? [ { source: '/(se/)?new-member(/hedvig)?', - has: [ - { - type: 'query', - key: 'code', - }, - ], - permanent: false, + has: [{ type: 'query', key: 'code' }], destination: '/api/campaign/:code?code=&next=/se/forsakringar', + permanent: false, + locale: false, + }, + { + source: '/(se/)?new-member(/hedvig)?', + destination: '/se/forsakringar', + permanent: false, locale: false, }, { @@ -134,7 +135,7 @@ module.exports = withBundleAnalyzer({ }, ] : [] - return [...shutDownMarketsInfo, ...oldSiteCampaigns, ...getExperimentVariantRedirects()] + return [...shutDownMarketsInfo, ...oldSiteRedirects, ...getExperimentVariantRedirects()] }, })