-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
36 lines (34 loc) · 960 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
module.exports = {
target: 'serverless',
experimental: {
redirects,
rewrites
}
}
async function redirects () {
return [
{ source: '/:path+/', permanent: true, destination: '/:path+' }, // remove trailing slash
// { source: '/', permanent: true, destination: '/en' }, // redirect home to english
//
// Re-writing the /_next folder does not seem to work,
// so we add a redirect for each rewrite.
//
{
source: '/_next/data/:deployment/:lang/produit/:path+',
permanent: true,
destination: '/_next/data/:deployment/:lang/product/:path+'
},
]
}
async function rewrites () {
return [
{ source: '/:lang/produit/:path+', destination: '/:lang/product/:path+' },
//
// Re-writing the /_next folder does not seem to work
//
// {
// source: '/_next/data/:deployment/:lang/produit/:path+',
// destination: '/_next/data/:deployment/:lang/product/:path+'
// },
]
}