-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy path404.html
More file actions
48 lines (45 loc) · 1.66 KB
/
404.html
File metadata and controls
48 lines (45 loc) · 1.66 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Not found — openunivcourses</title>
<meta name="robots" content="noindex" />
<script>
(function () {
var base = "/openunivcourses/";
var path = location.pathname;
var lowerBase = path.slice(0, base.length).toLowerCase();
// If we somehow reached this 404 with the wrong casing for the project segment
// (still under the same path), normalize to lowercase.
if (lowerBase === base && path.slice(0, base.length) !== base) {
var fixed = base + path.slice(base.length);
location.replace(fixed + location.search + location.hash);
return;
}
// For any other missing route under /openunivcourses/, go to the homepage.
// (If you convert to a SPA later, swap this for a spa-style redirect.)
if (path.toLowerCase().startsWith(base)) {
location.replace(base);
return;
}
// Fallback: send to the correct site root.
location.replace(base);
})();
</script>
<style>
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
margin: 0; display: grid; place-items: center; min-height: 100vh; }
main { text-align: center; padding: 2rem; }
a { text-decoration: none; }
.btn { display: inline-block; padding: .6rem 1rem; border: 1px solid #ccc; border-radius: .5rem; }
</style>
</head>
<body>
<main>
<h1>Page not found</h1>
<p>Taking you back to the site…</p>
<p><a class="btn" href="/openunivcourses/">Go to homepage</a></p>
</main>
</body>
</html>