Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 🐞 Routing Navigation Error "404 Page Not Found" After Refreshing Pages #428

Merged
merged 3 commits into from
Jun 23, 2024

Conversation

MastanSayyad
Copy link
Contributor

Hey @PranavBarthwal | Issue closes #420

To rectify the {404 Not Found Error}, it is necessary to establish redirect and rewrite rules for the React Router application. These rules will assist the application in preventing the "Page Not Found" error.

That's why I created a vercel.json file in the root directory of the project. This file will enable Vercel to configure the routing accurately.

  • I have linked and updated the navigations in the navbar for all pages
  • I have Added vercel.json : This image represents the structure of the vercel.json file and the code snippet.

image

  • The provided code snippet instructs Vercel to rewrite any incoming URL path to the root path.
  • This configuration ensures that when we initiate a redirect with a child path, Vercel will redirect it to the root path, effectively preventing the occurrence of the 404 Not Found Error.

Video/Screenshots (mandatory)

  • The changes are working or not will know only after the vercel deployment (As I believe it might not show any error in the preview or local host)
  • Please ensure that in "vercel deployment dashboard" you picked vitejs as a framework (if applicable)

Please take a look and review it, Thank You!!

Checklist:

  • I have mentioned the issue number in my Pull Request.
  • I have gone through the contributing.md file before contributing

Copy link

vercel bot commented Jun 22, 2024

@MastanSayyad is attempting to deploy a commit to the pranavbarthwal's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, you can contact the mentors for this project.

@surajvast1
Copy link
Collaborator

good job @MastanSayyad
LGTM @PranavBarthwal

Copy link

vercel bot commented Jun 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cosmo-xplore ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2024 1:45pm

@PranavBarthwal PranavBarthwal merged commit 8b366e9 into PranavBarthwal:main Jun 23, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug 🐞 Routing Navigation Error "404 Page Not Found" After Refreshing Pages
3 participants