-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path404.html
25 lines (23 loc) · 1.08 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>404</title>
<script>
const segment = 1;
//Gets the relative path and the hash of the URL.
//sessionStorage.redirect = '/' + location.pathname.slice(1).split('/').slice(segment).join('/');
sessionStorage.redirect = location.pathname.split('/').slice(0, 1 + segment).join('/');
sessionStorage.hash = location.hash;
//Forces the navigation back to the main page, since it's the only entry point that works.
//location.replace(location.pathname.split('/').slice(0, 1 + segment).join('/'));
location.replace('/' + location.pathname.slice(1).split('/').slice(segment).join('/'));
</script>
</head>
<body>
</body>
</html>