From aa3c20d4cf47ccf5928223533f57d0e80f806d83 Mon Sep 17 00:00:00 2001 From: Birk Jernstrom Date: Sat, 6 Jul 2024 14:03:05 +0200 Subject: [PATCH] docs: Fix redirect issue with FAQ --- clients/apps/web/next.config.mjs | 39 +++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/clients/apps/web/next.config.mjs b/clients/apps/web/next.config.mjs index 70835df6f3..b688b7932e 100644 --- a/clients/apps/web/next.config.mjs +++ b/clients/apps/web/next.config.mjs @@ -120,17 +120,34 @@ const nextConfig = { permanent: true, }, - // FAQ to docs - { - source: '/faq', - destination: '/docs/faq/overview', - permanent: false, - }, - { - source: '/faq/:path*', - destination: '/docs/faq/:path*', - permanent: false, - }, + // Redirect old FAQ to docs.polar.sh + ...ENVIRONMENT === 'production' ? + [ + { + source: '/faq', + destination: 'https://docs.polar.sh/faq/overview', + has: [ + { + type: 'host', + value: 'polar.sh', + } + ], + permanent: true, + }, + { + source: '/faq/:path*', + destination: 'https://docs.polar.sh/faq/:path*', + has: [ + { + type: 'host', + value: 'polar.sh', + } + ], + permanent: true, + }, + ] + : + [], // Logged-out user redirection {