Introduction: Add a Custom 404 Error Page to Your Site

This is actually very easy and can be done by anybody hosted on a standard server. 

A custom 404 page can be very helpful, it can save people leaving your site and it also adds a nice personal touch to your site. 

My site's here... 

Step 1: Build a Page

Make yourself the 404 page you want - I decided to go a bit silly with mine, it's actually just one big image, with an image map overlaid, because that's the way I fancied doing it just then. 

Save your custom 404 page in the root of your site. 

Call it something like "my404" or "errornotfound"

Step 2: Make the Special File

Open up notepad or some such.

Now type or paste in. 

ErrorDocument 404 /errornotfound.html

Or if it was called "my404"

ErrorDocument 404 /my404.html

You need to save this file as .htaccess if it's notepad, use quotes when saving otherwise it'll get saved as .htaccess.txt which is no good. 

Alternatively save it and edit the extension in the file name, if you've got view file extensions checked off in your options. 

Step 3: Send the Files

FTP these files to your website server, wait for it to refresh then try typing in a random page that doesn't exist. 

Basically the htaccess file instructs the server to show the file you specify in the document when a 404 error is served up. 


Comments

author
CaryB2 made it!(author)2015-08-04

Update as of August 2015, this article doesnt work anymore.

author
asasklfjklasfkljasklfjaklfsjkl made it!(author)2011-01-24

Very clever! (still can't access your site! I'll try at school...)

I made my own one, but I wanted to make it stand out and give people a jolt if they had their speakers turned up, so heres mine: http://www.geekify.geek.nz/error/404.html

author
killerjackalope made it!(author)2011-01-24

Does the direct address work?

http://killerjackalope.zxq.net/

It's weird that it won't work for you, nice 404, if slightly mean - the dark red and white look well.

author
asasklfjklasfkljasklfjaklfsjkl made it!(author)2011-01-24

Thanks - wanted it to be very bold.

Nope still doesn't work. Pinging the address gives me 'cannot resolve http://killerjackalope.zxq.net/: Unknown host'

I also can't access http://zxq.net either. Must be my ISP then.

author
killerjackalope made it!(author)2011-01-25

I'm an eejit try www.killerjackalope.co.nr as opposed to just http://

author
dombeef made it!(author)2011-02-06

i can connect though

author
killerjackalope made it!(author)2011-02-06

Well that's a start... I don't know, I'll get round to getting a proper host eventually...

author
killerjackalope made it!(author)2011-01-24

Bizarre, think I'll have to get me a spare host, well I can add another two domains from that host, so I'll arrange that and if it doesn't work then it could be worrying, how many ISPs don't cater to that one...

author
Dr.+Pepper made it!(author)2011-01-23

That's so funny.

author
killerjackalope made it!(author)2011-01-24

Thanks.

About This Instructable

9,796views

12favorites

License:

Bio: A Northern Ireland based maker with a propensity to cause trouble and freshly constructed family.
More by killerjackalope:Stroboscopic ZoomographyBalsamic Chilli Sweet Potato FriesWire Belt Hook for Drills
Add instructable to: