This commit is contained in:
Eshan Roy
2024-12-03 19:41:44 +05:30
parent baf2807fe8
commit 01ddacda24
4 changed files with 24 additions and 3 deletions

20
public/404.html Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404 - Not Found</title>
<script>
// Redirect all 404 routes to the homepage (index.html) to let React Router handle routing
var redirectTo = '/';
var pathname = location.pathname;
if (pathname && pathname !== '/' && pathname !== '/index.html') {
redirectTo += pathname;
}
location.replace(redirectTo);
</script>
</head>
<body>
<p>Redirecting...</p>
</body>
</html>