Skip to content

Commit

Permalink
added 404 file to catch server requests and redirect to index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
arositen committed May 29, 2024
1 parent ad532b0 commit 829f47c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 13 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="refresh" content="0; URL=./index.html" />
<title>Redirecting...</title>
</head>

<body></body>

</html>
4 changes: 1 addition & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Route, Routes, Navigate } from 'react-router-dom';
import { Route, Routes } from 'react-router-dom';
import { useState, useEffect } from "react";
import Navbar from '@/scenes/navbar';
import Splash from '@/scenes/splash';
Expand Down Expand Up @@ -41,8 +41,6 @@ function App() {
<Route path={`${basePath}/:section/details`} element={<Details />} />
<Route path={`${basePath}/:section/details/:id`} element={<Details />} />
<Route path={`${basePath}/checkout`} element={<Checkout />} />
{/* default redirect to home page */}
<Route path={`${basePath}/*`} element={<Navigate to={`${basePath}/`} />} />
</Routes>
<Footer />
</ShoppingCartProvider>
Expand Down

0 comments on commit 829f47c

Please sign in to comment.