Wood Chen

Configure Route Rewrites for Static Sites Deployed on vercel

0 comments106 views23 words

This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文

For example, add the following configuration (in nginx)

location / {
   try_files $uri $uri/ /index.html;
}

Configure it in vercel

Create a vercel.json file with the following content:

{
  "rewrites": [{ "source": "/:path*", "destination": "/index.html" }]
}

Then redeploy

Last updated 2024-01-14

Related posts

Comments 0