From 25da7176e7fd6a405ee6f97d027639336e91dc39 Mon Sep 17 00:00:00 2001
From: scottmakestech <83726258+scottmakestech@users.noreply.github.com>
Date: Wed, 5 Jan 2022 10:44:59 -0600
Subject: [PATCH] Add 404 page (#16)
---
README.md | 2 ++
layouts/404.html | 3 +++
netlify.toml | 6 ++++++
3 files changed, 11 insertions(+)
create mode 100644 layouts/404.html
diff --git a/README.md b/README.md
index 3e77a22..465f888 100644
--- a/README.md
+++ b/README.md
@@ -9,3 +9,5 @@ hugo server -F
And open http://localhost:1313/ in your
browser. Note that the -F flag will show items to be published in the future
(like blog posts with dates in the future).
+
+To view the 404 page when running locally, use /404.html.
diff --git a/layouts/404.html b/layouts/404.html
new file mode 100644
index 0000000..ed3d6b7
--- /dev/null
+++ b/layouts/404.html
@@ -0,0 +1,3 @@
+{{ define "main"}}
+That page doesn't exist, please check the address.
+{{ end }}
diff --git a/netlify.toml b/netlify.toml
index 761a81e..2bd3873 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -94,3 +94,9 @@
to = "https://www.memorysafety.org/:splat"
status = 301
force = true
+
+[[redirects]]
+ from = "/*"
+ to = "/404.html"
+ status = 404
+ force = false