Skip to content

Commit 9c3dcb7

Browse files
committed
fix: update 404.html to preserve original path for client-side routing on GitHub Pages
1 parent ee34079 commit 9c3dcb7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

public/404.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta http-equiv="refresh" content="0; URL=/" />
4+
<meta charset="UTF-8" />
5+
<title>Redirecting...</title>
56
<script>
6-
window.location.href = "/";
7+
// Redirect to original path
8+
var redirectTo = window.location.pathname;
9+
window.location.replace("/#" + redirectTo);
710
</script>
811
</head>
912
<body>

0 commit comments

Comments
 (0)