Eleventy Recipes Wordmark

Eleventy Recipes

Add a 404 page

By Raymond Camden

The actual contents can vary of course, but in general a good 404 page informs the user the content they wanted was not found and attempts to give them resources to find what they were looking for.

Prerequisites

Directions

  1. Create a file in your project root called 404.md and add the following:
---
title: Oops! Not Found
layout: base
permalink: /404.html
---


This is where you should tell the user how to find their content. Maybe on the [home page?](./)
  1. Depending your platform, your job is done. On Netlify and GitHub pages, they will automatically load this file when a page is not found. For other platforms, check their documentation to see how to specify which file/URL is used when a page is not found.

Resources