My vercel site accidentally made 404 Not Found error so I added ‘rewrites’ to vercel.json.
{
"rewrites": [
{"source": "/(.*)", "destination": "/"}
],
"cleanUrls": true
}
However, I’m not sure it is because of ‘rewrites’, public/404.html is not automatically redirected. It is redirected to index.html. I have tried several methods, but they didn’t work:
{
"rewrites": [
{ "source": "/(.*)", "destination": "/index.html" }
],
"redirects": [
{
"source": "/:path*",
"destination": "/404.html",
"statusCode": 404
}
],
"cleanUrls": true
}
or
{
"rewrites": [
{ "source": "/404", "destination": "/404.html" },
{"source": "/(.*)", "destination": "/"}
],
"cleanUrls": true
}
But I also couldn’t fix 404 Not Found error if I didn’t use rewrites.