-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
55 lines (50 loc) · 2.51 KB
/
Copy path404.html
File metadata and controls
55 lines (50 loc) · 2.51 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting...</title>
<script>
// Handle routing for GitHub Pages
(function() {
const path = window.location.pathname;
// Christmas Bingo routing
if (path.includes('/christmas-bingo/')) {
// Check if it's a user view page: /christmas-bingo/[group]/[user]/view/
if (path.match(/\/christmas-bingo\/[^\/]+\/[^\/]+\/view/)) {
window.location.replace('/christmas-bingo/view.html?redirect=' + encodeURIComponent(path) + window.location.search.replace('?', '&') + window.location.hash);
return;
}
// Check if it's a user edit page: /christmas-bingo/[group]/[user]/edit/
if (path.match(/\/christmas-bingo\/[^\/]+\/[^\/]+\/edit/)) {
window.location.replace('/christmas-bingo/edit.html?redirect=' + encodeURIComponent(path) + window.location.search.replace('?', '&') + window.location.hash);
return;
}
// Check if it's an admin page: /christmas-bingo/[group]/admin/
if (path.match(/\/christmas-bingo\/[^\/]+\/admin/)) {
window.location.replace('/christmas-bingo/admin.html?redirect=' + encodeURIComponent(path) + window.location.search.replace('?', '&') + window.location.hash);
return;
}
// Check if it's a group page: /christmas-bingo/[group]/
if (path.match(/\/christmas-bingo\/[^\/]+\/?$/) && !path.includes('register') && !path.includes('.html')) {
window.location.replace('/christmas-bingo/index.html?redirect=' + encodeURIComponent(path) + window.location.search.replace('?', '&') + window.location.hash);
return;
}
}
// If no match, show actual 404
document.body.innerHTML = `
<div style="font-family: Arial, sans-serif; text-align: center; padding: 50px;">
<h1>404 - Page Not Found</h1>
<p>The page you're looking for doesn't exist.</p>
<p><a href="/">Go to Home</a></p>
</div>
`;
})();
</script>
</head>
<body>
<div style="font-family: Arial, sans-serif; text-align: center; padding: 50px;">
<p>Redirecting...</p>
</div>
</body>
</html>