Problem Description:
Hello, I have a project that relies on multiple separate HTML pages, and I am facing an issue configuring vercel.json
to redirect correctly to these pages. When I try to access a sub-page, like/blogs
or /ourServices
, I get a 404 (Not Found) error.
Project Link on Vercel: https://digitalize-v-2-p1by.vercel.app
Steps I’ve Taken:
Configured vercel.json: I added rewrite rules in vercel.json to ensure that each path directs to the correct page. I specified each required path manually.
Paths Configured:
/ourServices → Should direct to /digitalize-v.2/ourServices/html/digitalize/service.html
/blogs → Should direct to /digitalize-v.2/blogs/html/digitalize/blogs.html
/blog-details → Should direct to /digitalize-v.2/blogs-details/html/digitalize/blog-details.html
Current vercel.json Configuration:
{
“version”: 2,
“rewrites”: [
{
“source”: “/assets/(.)",
“destination”: “/html/digitalize/assets/$1”
},
{
“source”: “/about”,
“destination”: “/html/digitalize/index.html”
},
{
“source”: “/contact”,
“destination”: “/html/digitalize/index.html”
},
{
“source”: “/ourServices”,
“destination”: “/digitalize-v.2/ourServices/html/digitalize/service.html”
},
{
“source”: “/blogs”,
“destination”: “/digitalize-v.2/blogs/html/digitalize/blogs.html”
},
{
“source”: “/blog-details”,
“destination”: “/digitalize-v.2/blogs-details/html/digitalize/blog-details.html”
},
{
“source”: "/(.)”,
“destination”: “/html/digitalize/index.html”
}
],
“cleanUrls”: true,
“trailingSlash”: false
}
Here is the link to my GitHub repository:
Deployment Link:
https://digitalize-v-2-p1by-a99n9ezub-fadyfatheys-projects.vercel.app/