From 6eaba7a9a005c9eb5776f49f44362447e9161fda Mon Sep 17 00:00:00 2001 From: Greg Rickaby Date: Thu, 2 May 2024 07:51:42 -0500 Subject: [PATCH] redirect to new url --- next.config.mjs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index 80873803..3daf23bc 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,13 +1,28 @@ /** @type {import('next').NextConfig} */ const nextConfig = { async redirects() { - return [ - { - source: '/r', - destination: '/', - permanent: true - } - ] + if (process.env.VERCEL_ENV === 'production') { + return [ + { + source: '/', + destination: 'https://reddit-viewer.com/', + permanent: true + }, + { + source: '/r', + destination: '/', + permanent: true + } + ] + } else { + return [ + { + source: '/r', + destination: '/', + permanent: true + } + ] + } }, logging: { fetches: {