-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvercel.config.json
More file actions
52 lines (52 loc) · 1.1 KB
/
vercel.config.json
File metadata and controls
52 lines (52 loc) · 1.1 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
{
"beforeRoutes": [
{
"$comment": "when visit /go/cv, rewrite to correct pdf file",
"src": "^/go/cv$",
"dest": "/pdfs/kamontat-cv-v4.2.pdf"
},
{
"$comment": "when visit /go/resume, rewrite to correct pdf file",
"src": "^/go/resume$",
"dest": "/pdfs/kamontat-resume-v2.2.pdf"
},
{
"$comment": "when visit blog.kc.in.th/*, redirect to kc.in.th/en/blog/*",
"src": "^/(?<lang>en|th)[/]?(?<path>.*)$",
"has": [
{
"type": "host",
"value": "blog.kc.in.th"
}
],
"headers": {
"Location": "https://kc.in.th/$lang/blog/$path"
},
"status": 301
},
{
"$comment": "when visit blog.kc.in.th/*, redirect to kc.in.th/en/blog/*",
"src": "^/(?<path>.*)$",
"has": [
{
"type": "host",
"value": "blog.kc.in.th"
}
],
"headers": {
"Location": "https://kc.in.th/en/blog/$path"
},
"status": 301
}
],
"afterRoutes": [
{
"$comment": "when visit <domain>/*, redirect to /en/* version",
"src": "^/(?<path>(?:(?!th(\/|$)|en(\/|$)|blog(\/|$)|pdfs\/)).*)$",
"headers": {
"Location": "/en/$path"
},
"status": 301
}
]
}