-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
106 lines (101 loc) · 4.64 KB
/
Copy pathnext.config.ts
File metadata and controls
106 lines (101 loc) · 4.64 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
105
106
import type { NextConfig } from "next";
import { getTool } from './lib/tools';
const cardBattleHref = getTool('Card Battle').href;
const cardMatchHref = getTool('Card Match').href;
const nextConfig: NextConfig = {
turbopack: {},
reactStrictMode: false,
experimental: {
preloadEntriesOnStart: false,
},
images: {
unoptimized: true,
},
async redirects() {
return [
{
source: '/tin-tuc/tag/:tag',
destination: '/tin-tuc',
permanent: true,
},
{
source: '/:pair([^/]*-vs-[^/]*)',
destination: `${cardBattleHref}/:pair`,
permanent: true,
},
{
source: '/so-sanh',
destination: cardBattleHref,
permanent: true,
},
{
source: '/so-sanh/:path*',
destination: `${cardBattleHref}/:path*`,
permanent: true,
},
{
source: '/goi-y-the',
destination: cardMatchHref,
permanent: true,
},
// category paths - must be before generic /cards/:slug* rule
{ source: '/cards', destination: '/the', permanent: true },
{ source: '/cards/credit', destination: '/loai-the/the-tin-dung', permanent: true },
{ source: '/cards/debit', destination: '/loai-the/the-ghi-no', permanent: true },
{ source: '/cards/2in1', destination: '/loai-the/the-hybrid', permanent: true },
{ source: '/cards/visa', destination: '/the', permanent: true },
{ source: '/cards/mastercard', destination: '/the', permanent: true },
{ source: '/cards/amex', destination: '/the', permanent: true },
{ source: '/cards/jcb', destination: '/the', permanent: true },
{ source: '/cards/napas', destination: '/the', permanent: true },
{ source: '/cards/unionpay', destination: '/the', permanent: true },
{ source: '/cards/networks/:path*', destination: '/the', permanent: true },
{ source: '/cards/co-branded/:path*', destination: '/the', permanent: true },
// generic card slug - after category rules
{
source: '/cards/:slug*',
destination: '/the/:slug*',
permanent: true,
},
// card type pages - old flat URLs redirect to new /loai-the/* structure
{ source: '/the-tin-dung', destination: '/loai-the/the-tin-dung', permanent: true },
{ source: '/the-ghi-no', destination: '/loai-the/the-ghi-no', permanent: true },
{ source: '/the-hybrid', destination: '/loai-the/the-hybrid', permanent: true },
{ source: '/cards/hybrid', destination: '/loai-the/the-hybrid', permanent: true },
{ source: '/the-2-trong-1', destination: '/loai-the/the-hybrid', permanent: true },
{ source: '/the-kim-loai', destination: '/loai-the/the-hybrid', permanent: true },
{ source: '/the-tin-dung-amex', destination: '/the', permanent: true },
{ source: '/the-tin-dung-phi-thuong-nien-thap', destination: '/loai-the/the-tin-dung-mien-phi-thuong-nien', permanent: true },
{ source: '/openwallet-app', destination: '/', permanent: true },
{ source: '/llms/:path*', destination: '/', permanent: true },
{ source: '/api/patches/:path*', destination: '/', permanent: true },
// persona pages - old flat URLs redirect to nested structure
{ source: '/the-shopee', destination: '/linh-vuc/shopee', permanent: true },
{ source: '/the-sieu-thi', destination: '/linh-vuc/sieu-thi', permanent: true },
{ source: '/the-chi-tieu-dich-vu-so', destination: '/linh-vuc/dich-vu-so', permanent: true },
{ source: '/the-danh-cho-giao-duc', destination: '/linh-vuc/gia-dinh', permanent: true },
{ source: '/the-danh-cho-y-te', destination: '/linh-vuc/gia-dinh', permanent: true },
{ source: '/the-danh-cho-bao-hiem', destination: '/linh-vuc/gia-dinh', permanent: true },
{ source: '/the-doanh-nghiep', destination: '/linh-vuc/doanh-nghiep', permanent: true },
// route rename redirect
{ source: '/the-theo-nhu-cau', destination: '/linh-vuc', permanent: true },
{ source: '/the-theo-nhu-cau/:path*', destination: '/linh-vuc/:path*', permanent: true },
{ source: '/banks', destination: '/ngan-hang', permanent: true },
{
source: '/banks/:slug*',
destination: '/ngan-hang/:slug*',
permanent: true,
},
{ source: '/changelog', destination: '/roadmap', permanent: true },
{ source: '/openwallet-chat', destination: '/owie-chat', permanent: true },
{ source: '/openwallet-mcp', destination: '/mcp', permanent: true },
{ source: '/blog', destination: '/tin-tuc', permanent: true },
{
source: '/blog/:slug*',
destination: '/tin-tuc/:slug*',
permanent: true,
},
];
},
};
export default nextConfig;