-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path404.html
26 lines (21 loc) · 843 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>
<head>
<meta charset="utf-8" />
<title>404</title>
<script>
const segment = 1;
alert('Path + Hash: ' + location.pathname + location.hash);
sessionStorage.redirect = '/' + location.pathname.slice(1).split('/').slice(segment).join('/');
sessionStorage.hash = location.hash;
//Forces the navigation back to the main page.
location.replace(location.pathname.split('/').slice(0, 1 + segment).join('/'));
</script>
</head>
<body>
</body>
</html>