From de2ec512f1cbeed533987384c98fcf4dfb0029d8 Mon Sep 17 00:00:00 2001 From: leomet07 Date: Thu, 23 Nov 2023 21:49:05 -0500 Subject: [PATCH] Configure fallback redirects for old links + reset the /apply/web link --- next.config.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/next.config.js b/next.config.js index 93a2d3f..b8c7479 100644 --- a/next.config.js +++ b/next.config.js @@ -39,10 +39,26 @@ module.exports = { async redirects() { return [ { - source: '/apply/web', - destination: 'https://forms.gle/oiQTKk374tzZ3iPZA', + source: "/apply/web", + destination: "mailto:web@stuyspec.com", permanent: true, }, - ] + ]; + }, + async rewrites() { + return { + fallback: [ + { + // Redirect old site links with one subdeps to article link + source: "/:department/:slug", + destination: `/article/:slug`, + }, + { + // Redirect old site links with two subdeps to article link + source: "/:department/:sub_section/:slug", + destination: `/article/:slug`, + }, + ], + }; }, };