Skip to content

Commit 4a32944

Browse files
Add a 404 file to try and handle Github pages redirections (#55)
1 parent 59dfe53 commit 4a32944

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

static/404.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Redirecting...</title>
6+
<script>
7+
// Get the current path
8+
const path = window.location.pathname;
9+
10+
// Remove trailing slash if present
11+
if (path.endsWith('/')) {
12+
const newPath = path.slice(0, -1);
13+
window.location.replace(newPath);
14+
} else {
15+
// If no trailing slash, try to load the SPA
16+
window.location.replace('/');
17+
}
18+
</script>
19+
</head>
20+
<body>
21+
<p>Redirecting...</p>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)