-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path404.html
More file actions
63 lines (58 loc) · 1.6 KB
/
404.html
File metadata and controls
63 lines (58 loc) · 1.6 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
56
57
58
59
60
61
62
63
---
permalink: /404.html
---
<!doctype html>
<html>
<head>
<title>Stevens Game Development Club</title>
<script src="/data/page.js"></script>
<script src="/data/redirects.js"></script>
<script>
window.onload = function () {
try {
var isNavbar = false;
var isRedirect = false;
var redirectLink = "";
var s = window.location.href;
var hash = s.substring(s.lastIndexOf('/') + 1, s.length).toLowerCase();
var redirects = getRedirects();
for(var i = 0; i < redirects.length; i++) {
if (hash === redirects[i].name) {
isRedirect = true;
redirectLink = redirects[i].link;
}
}
if (isRedirect) {
window.location = redirectLink;
}
else {
var navbarMembers = getNavbarMembers();
for(var i = 0; i < navbarMembers.length; i++) {
if (hash === navbarMembers[i].toLowerCase()) {
isNavbar = true;
}
}
if (!isNavbar && hash != "redirects")
hash = "404";
if (hash != "redirects") {
var newLocation = "http://sgdc.github.io/#" + hash;
window.location = newLocation;
} else { //if /redirects, display all redirects on page
var allRedirects = "<h1>SGDC Website Redirects</h1>";
for (var i = 0; i < redirects.length; i++) {
allRedirects += "/" + redirects[i].name;
allRedirects += ": <a href=\"" + redirects[i].link + "\">" + redirects[i].link + "</a><br /><br />";
}
document.body.innerHTML = allRedirects;
}
}
} catch (e) {
window.location = "http://sgdc.github.io/#404";
}
}
</script>
</head>
<body style="font-size: 14px; font-family: monospace;">
Redirecting...
</body>
</html>