-
Notifications
You must be signed in to change notification settings - Fork 1
/
404.html
26 lines (26 loc) · 957 Bytes
/
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
<!doctype html>
<html>
<body>
<script>
(async () => {
const res = await fetch(`https://content.exokit.org/filename${window.location.pathname}`);
if (res.ok) {
const j = await res.json();
const redirectLocation = j.location;
// console.log('redirecting', redirectLocation, window.location.protocol + '//' + window.location.host + '/?p=' + encodeURIComponent(redirectLocation));
if (redirectLocation) {
window.location.href = window.location.protocol + '//' + window.location.host + '/?p=' + encodeURIComponent(redirectLocation);
} else {
const h1 = document.createElement('h1');
h1.innerText = `Not found: ${escape(window.location.pathname)} ${JSON.stringify(j)}`;
document.body.appendChild(h1);
}
} else {
const h1 = document.createElement('h1');
h1.innerText = `Not found: ${escape(window.location.pathname)}`;
document.body.appendChild(h1);
}
})();
</script>
</body>
</html>