404 Research Lab - 404lab.com

Do it yourself 404
Back   Home

Customizing Your 404 with thttpd

There's a separate file for each error number, all stored in one special directory. The directory name is 'errors', at the top of the web directory tree. The error files should be named 'errNNN.html', where NNN is the error number. So for example, to make a custom error page for the authentication failure error, which is number 401, you would put your HTML into the file 'errors/err401.html'. If no custom error file is found for a given error number, then the usual built-in error page is generated.

If you're using the virtual hosts option, you can also have different custom error pages for each different virtual host. In this case you put another 'errors' directory in the top of that virtual host's web tree. thttpd will look first in the virtual host errors directory, and then in the server-wide errors directory, and if neither of those has an appropriate error file then it will generate the built-in error.

See the thttpd documentation.

Area 404 404 for Webmasters 404 Purgatory Yikes! 404! History of 404