forked from ospc-org/ospc-org.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.html
55 lines (50 loc) · 1.48 KB
/
404.html
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
---
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
<script>
var url = location.href;
var apps_domain = "https://apps.ospc.org/";
// cur_domain will be https://www.ospc.org in production.
var cur_domain = "https://" + location.hostname + "/";
// If the user is trying to access an archived run, then they may have a link
// to wwww.ospc.org/{extension}/{runnumber}/. If the extension matches any
// of the below extensions, then they will be redirected to
// apps_domain/{extension}/query.
var extentions = [
"taxbrain",
"ccc",
"dynamic",
"dynamic/behavioral",
"dynamic/behavior_results",
"dynamic/macro",
"dynamic/macro_results",
];
// Check if the url starts with https://www.ospc.org/{ext}
// Redirect if there is a match.
if (extentions.some(ext => url.startsWith(cur_domain + ext))) {
// Grab the part of the url that comes after cur_domain.
// This part would contain the run number and/or GET parameters.
var spl = url.split(cur_domain);
var archived_url = apps_domain + spl[1];
console.log("redirecting to: ", archived_url);
window.location.replace(archived_url);
}
</script>