-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
104 lines (102 loc) Β· 3 KB
/
Copy pathnext.config.mjs
File metadata and controls
104 lines (102 loc) Β· 3 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import nextra from 'nextra'
// Set up Nextra with its configuration
const withNextra = nextra({
// ... Add Nextra-specific options here
})
// Export the final Next.js config with Nextra included
export default withNextra({
// ... Add regular Next.js options here
basePath: '/docs',
async redirects() {
// Paths with real inbound traffic (GA/Search Console) that 404 otherwise.
// Sources/destinations are relative to basePath (/docs). TEMPORARY (302) on
// purpose, same policy as the landing: 301/308 get cached hard by
// browsers/CDNs, which would block serving a real page here later.
return [
// Section roots: folders without an index page
{ source: '/auth', destination: '/auth/get-started', permanent: false },
{
source: '/deploy',
destination: '/deploy/get-started',
permanent: false
},
{
source: '/platform',
destination: '/platform/pricing',
permanent: false
},
{
source: '/auth/guides',
destination: '/auth/guides/migrate-from-auth0',
permanent: false
},
// NOTE: /auth/quickstart is NOT here β it has a real index page now, and
// a redirect would shadow it. This is why these are 302s.
{
source: '/auth/extensibility',
destination: '/auth/extensibility/actions',
permanent: false
},
{
source: '/deploy/domains',
destination: '/deploy/domains/custom-domain',
permanent: false
},
{
source: '/deploy/guides',
destination: '/deploy/guides/migrate-from-vercel',
permanent: false
},
// Old flat URLs for pages that live under /auth/oauth-flows (indexed/linked externally)
{
source: '/auth/authorization-code',
destination: '/auth/oauth-flows/authorization-code',
permanent: false
},
{
source: '/auth/refresh-token',
destination: '/auth/oauth-flows/refresh-token',
permanent: false
},
{
source: '/auth/client-credentials',
destination: '/auth/oauth-flows/client-credentials',
permanent: false
},
{
source: '/auth/device-code',
destination: '/auth/oauth-flows/device-code',
permanent: false
},
{
source: '/auth/token-exchange',
destination: '/auth/oauth-flows/token-exchange',
permanent: false
},
// Academy pages linked without the /academy prefix
{
source: '/auth/exam',
destination: '/auth/academy/exam',
permanent: false
},
{
source: '/auth/lab',
destination: '/auth/academy/lab',
permanent: false
}
]
},
async rewrites() {
return [
{
source: '/ingest/static/:path*',
destination: 'https://eu-assets.i.posthog.com/static/:path*'
},
{
source: '/ingest/:path*',
destination: 'https://eu.i.posthog.com/:path*'
}
]
},
skipTrailingSlashRedirect: true
})