James Ball

How Do You Do, Fellow Kids?

Octopress: Custom 404 Page

Open up config.ru from the root directory and update the sinatra not_found route to the following:

config.ru
1
2
3
not_found do
  send_sinatra_file('404')
end

This will redirect to http://yourdomain.com/404/ where the page is found, but we still need to create a page.

To do this use rake new_page[404]. This will create a new file named index.markdown in your /source/404 directory:

404/indexlink
1
2
3
4
5
6
7
8
9
10
---
layout: page
title: "404 Error"
comments: false
sharing: false
footer: false
---
Whoops, the page you’re looking for cannot be found.

Maybe you can find what you are looking for in the [archives](/blog/archives/).

View my 404 page here.