-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy path404.html
38 lines (34 loc) · 1.24 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
---
permalink: /404.html
---
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta http-equiv = "refresh" content = "20; url=https://100r.co/site/home.html" />
<link rel='alternate' type='application/rss+xml' title='Hundred Rabbits Journal' href='http://100r.co/links/rss.xml' />
<title>100R(error)</title>
</head>
<body>
<p style='max-width: 500px'>Hi there, the page you are looking for does not exist, please <a href='https://github.com/hundredrabbits/100r.co/issues/new' target='_blank'>report the broken link</a>, continue to the <a href='/site/home.html'>home page</a> or see a <a href='/site/index.html'>list of all pages</a>.</p>
<script>
'use strict'
const parts = window.location.pathname.split("/")
const target = parts.slice(-1)
const filename = toFilename(target[0])
const filepath = `https://100r.co.com/site/${filename}.html`
if(UrlExists(filepath)){
window.location.replace(filepath)
}
function toFilename(str){
return `${str}`.replace('#','').replace(/[\W_]+/g,"_").toLowerCase().trim()
}
function UrlExists(url) {
const http = new XMLHttpRequest()
http.open('HEAD', url, false)
http.send()
return http.status != 404
}
</script>
</body>
</html>