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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ function Navbar() {
</li>
{renderAPODLink()}
<li className="navbar-list-item" onClick={handleMenuClose}>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/mars-rover">MartianImagery</NavLink>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/marsrover">MartianImagery</NavLink>
</li>
<li className="navbar-list-item" onClick={handleMenuClose}>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/nasa-projects">NASA's Projects</NavLink>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/nasaprojects">NASA's Projects</NavLink>
</li>
<li className="navbar-list-item" onClick={handleMenuClose}>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/about">About us</NavLink>
Expand Down
6 changes: 3 additions & 3 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const router = createBrowserRouter(
createRoutesFromElements(
<Route path='/' element={<App />}>
<Route index element={<Home />} />
<Route path='mars-rover' element={<MarsRover />} />
<Route path='nasa-projects' element={<NasaProjects />} />
<Route path='about' element={<About />} />
<Route path='/marsrover' element={<MarsRover />} />
<Route path='/nasaprojects' element={<NasaProjects />} />
<Route path='/about' element={<About />} />
<Route path='*' element={<NotFoundPage />} />
</Route>
)
Expand Down
5 changes: 5 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rewrites": [
{"source": "/(.*)", "destination": "/"}
]
}
Loading