add redirects structure

This commit is contained in:
Corwin Smith 2022-12-09 00:22:16 -07:00
parent 4315911af4
commit 35db2a4906
2 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,5 @@
/** @type {import('next').NextConfig} */
const { redirects: redirectsList } = require('./redirects');
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
@ -14,5 +15,8 @@ module.exports = withMDX({
reactStrictMode: true,
swcMinify: true,
// Append the default value with md extensions
pageExtensions: ['ts', 'tsx', 'md', 'mdx']
pageExtensions: ['ts', 'tsx', 'md', 'mdx'],
async redirects() {
return redirectsList
},
});

11
redirects.js Normal file
View File

@ -0,0 +1,11 @@
const redirects = [
{
source: '/about',
destination: '/',
permanent: true,
}
];
module.exports = {
redirects
}