This repository was archived by the owner on Dec 20, 2024. It is now read-only.
Issue with Rewrite Configuration on Vercel Leading to 404 Errors for Sub-Pages #7594
Replies: 1 comment
-
This discussion was automatically closed because the community moved to vercel.community |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Acknowledgement
Question
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:
https://github.com/FadyFathey/digitalize-v.2.git
Deployment Link:
https://digitalize-v-2-p1by-a99n9ezub-fadyfatheys-projects.vercel.app/
Beta Was this translation helpful? Give feedback.
All reactions