diff --git a/src/docs/index.html b/src/docs/index.html
index e233c24..6dc9cf0 100644
--- a/src/docs/index.html
+++ b/src/docs/index.html
@@ -1,6 +1,7 @@
{{$pathParts := splitList "/" .OriginalReq.URL.Path}}
{{$markdownFilename := default "index" (slice $pathParts 2 | join "/")}}
{{$markdownFilePath := printf "/docs/markdown/%s.md" $markdownFilename}}
+{{if not (fileExists $markdownFilePath)}}{{httpError 404}}{{end}}
{{$markdownFile := (include $markdownFilePath | splitFrontMatter)}}
{{$title := default $markdownFilename $markdownFile.Meta.title}}