-
-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy path404.html
More file actions
39 lines (35 loc) · 1.34 KB
/
404.html
File metadata and controls
39 lines (35 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!-- 404 pages for github pages to redirect correctly -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>404 - Not Found</title>
<script type="text/javascript">
// Extract the pathname from the URL
var pathname = window.location.pathname;
// Don't redirect static HTML files — let them 404 naturally
if (pathname.endsWith('.html') && pathname !== '/index.html') {
// This is a direct .html file request that doesn't exist; don't redirect
} else {
// Redirect logic based on pathname (SPA client-side routing)
let playgroundPath = '/audiolab/playground/';
let docsPath = '/audiolab/docs/';
let sherpaVoicePath = '/audiolab/sherpa-voice/';
if (pathname.startsWith(playgroundPath)) {
window.location.href = playgroundPath;
} else if (pathname.startsWith(docsPath)) {
window.location.href = docsPath;
} else if (pathname.startsWith(sherpaVoicePath)) {
window.location.href = sherpaVoicePath;
} else {
// Default redirect (e.g., to the home page)
window.location.href = '/audiolab/';
}
}
</script>
</head>
<body>
<h1>404 - Not Found</h1>
<p>Redirecting...</p>
</body>
</html>