Add 404 page

This commit is contained in:
Yarmo Mackenbach 2020-06-29 11:27:45 +02:00
parent 2252271995
commit 6ac63fe7ea
2 changed files with 50 additions and 0 deletions

View file

@ -138,4 +138,11 @@ if(is_array($match) && is_callable($match['target'])) {
} }
} else { } else {
// No route was matched // No route was matched
$content = file_get_contents("pages/template.html");
$pageTitle = "404";
$pageContent = "404 - This page could not be found :(";
$content = str_replace('%TITLE%', $pageTitle, $content);
$content = str_replace('%CONTENT%', $pageContent, $content);
header('Content-Type: text/html; charset=utf-8');
echo($content);
} }

43
pages/404.html Normal file
View file

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/favicon.png">
<title>%TITLE% - Keyoxide</title>
<link rel="stylesheet" href="/assets/styles.css">
</head>
<body>
<header>
<div class="container">
<a href="/">Keyoxide</a>
<div class="spacer"></div>
<nav>
<a href="/verify">verify</a>
<a href="/encrypt">encrypt</a>
<a href="/proofs">proofs</a>
</nav>
</div>
</header>
<div class="container">
<h1>%TITLE%</h1>
<div class="content">
%CONTENT%
</div>
<footer>
<p>
Sitemap:
<a href="/">index</a> -
<a href="/encrypt">encrypt</a> -
<a href="/verify">verify</a> -
<a href="/proofs">proofs</a> -
<a href="/guides">guides</a> -
<a href="/faq">faq</a>
</p>
</footer>
</div>
</body>
</html>