Building BobSmithPhotography.net has stopped expanding because I've been overwhelmed with spam on the comment forums. So, if you're here and have questions about web design come and visit Forums, Blogs, Wikis dot com. It has articles that I've written, some of which are also here, and a web design forum as well so you can ask any questions you may have. There is still a lot of good stuff here though, so poke around the links and take a look.

Home » Other Tips » .htaccess » Custom Error Pages

Custom Error Pages

If you've gone to a page that doesn't exist on major websites you've probably noticed that they use custom 404 pages.   How do they do this?  Among other ways, the .htaccess file allows us to build custom error pages.

The first thing you need to do is create your error page.  Go ahead and build it. Us the tutorial if you need a little help.

Next, add the following code to your .htaccess file.

ErrorDocument 404 /path/to/your/error404.html

This tells Apache that you want it to return the file /path/to/your/error404.html file in place of a default file not found page.

You can also use the same code for other errors.

Content managed by the Etomite Content Management System.