-
Notifications
You must be signed in to change notification settings - Fork 28k
/
Copy pathnext.config.js
41 lines (38 loc) · 996 Bytes
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// @ts-check
/**
* @type {import('next').NextConfig}
**/
const nextConfig = {
// Uncomment the line below to enable basePath, pages and
// redirects will then have a path prefix (`/app` in this case)
//
// basePath: '/app',
async redirects() {
return [
{
source: "/team",
destination: "/about",
permanent: false,
},
// Path Matching - will match `/old-blog/a`, but not `/old-blog/a/b`
{
source: "/old-blog/:slug",
destination: "/news/:slug",
permanent: false,
},
// Wildcard Path Matching - will match `/blog/a` and `/blog/a/b`
{
source: "/blog/:slug*",
destination: "/news/:slug*",
permanent: false,
},
// Regex Path Matching - The regex below will match `/post/123` but not `/post/abc`
{
source: "/post/:slug(\\d{1,})",
destination: "/news/:slug",
permanent: false,
},
];
},
};
module.exports = nextConfig;