Current course:

How to catch a 404

First of all, what IS a "404"?

When someone tries to go to a file on your site that doesn't exist, it will give an "Not Found" error. This is error is a "404". There are other numbers for "Permission Denied", "Permanently moved"...etc etc.

A good example is: in your browser, go to (or anything else after

You'll notice it does not go to a generic "Not Found" page - instead, it goes to a custom Twitter "Sorry, that page doesn't exists" page.

To do the same on your site, simply create a ".htaccess" file and put it in your root directory. (You can do so by just creating a new text document, and editing the name to just ".htaccess" without the quotes.

In that htaccess file (you can edit it in a text editor), add the following (where "/404.html" is the file you want the user to be directed upon a 404 error):

ErrorDocument 404 /404.html