mirror of
https://github.com/rohitg00/ai-engineering-from-scratch.git
synced 2026-10-02 01:54:39 +08:00
Vercel headers.source matches the incoming request URL, not the rewrite destination. The /(.*)\.html rule did not apply to the clean URLs because incoming /glossary never sees .html in its path. Adds an explicit rule for the four rewritten clean URLs.
39 lines
1.2 KiB
JSON
39 lines
1.2 KiB
JSON
{
|
|
"buildCommand": "node site/build.js",
|
|
"outputDirectory": "site",
|
|
"framework": null,
|
|
"installCommand": "echo skip",
|
|
"rewrites": [
|
|
{ "source": "/glossary", "destination": "/glossary.html" },
|
|
{ "source": "/catalog", "destination": "/catalog.html" },
|
|
{ "source": "/path", "destination": "/prereqs.html" },
|
|
{ "source": "/roadmap", "destination": "/prereqs.html" }
|
|
],
|
|
"headers": [
|
|
{
|
|
"source": "/(.*)\\.(css|js|png|jpg|jpeg|svg|webp|woff2|woff|ttf|ico)",
|
|
"headers": [
|
|
{ "key": "Cache-Control", "value": "public, max-age=86400, s-maxage=604800, stale-while-revalidate=2592000" }
|
|
]
|
|
},
|
|
{
|
|
"source": "/(.*)\\.html",
|
|
"headers": [
|
|
{ "key": "Cache-Control", "value": "public, max-age=300, s-maxage=86400, stale-while-revalidate=604800" }
|
|
]
|
|
},
|
|
{
|
|
"source": "/",
|
|
"headers": [
|
|
{ "key": "Cache-Control", "value": "public, max-age=300, s-maxage=86400, stale-while-revalidate=604800" }
|
|
]
|
|
},
|
|
{
|
|
"source": "/(glossary|catalog|path|roadmap)",
|
|
"headers": [
|
|
{ "key": "Cache-Control", "value": "public, max-age=300, s-maxage=86400, stale-while-revalidate=604800" }
|
|
]
|
|
}
|
|
]
|
|
}
|