Skip to content

Commit

Permalink
Adds 404 page with redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
jermnelson committed May 6, 2021
1 parent 906535f commit 522978d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">
<head>
<link href="/css/owl.css" rel="stylesheet" type="text/css" />
<link href="/css/Primer.css" rel="stylesheet" type="text/css" />
<link href="/css/rec.css" rel="stylesheet" type="text/css" />
<link href="/css/extra.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/css/favicon.ico" />
</head>
<body>
<script>
const unknown_page = location.pathname
const alt_page = `${unknown_page}/`

// Try to retrieve page with trailing slash added
fetch(alt_page)
.then(result=>{
location.href = alt_page
})
.error(error => {
const error = document.getElementById('message')
error.innerHTML(`${unknown_page} not found`)
})
</script>
<h1>404 - Not Found</h1>
<p id="message"></p>
</body>
</html>

0 comments on commit 522978d

Please sign in to comment.