PDA

View Full Version : Custom Error Pages with PHP and Apache


llbbl
05-20-2005, 06:16 AM
Using PHP and Apache, you can turn your "Page Not Found" messages into more than bland error reports. You can serve an alternate page based on the name of the page that was not found, create a page on the fly from a database, or send an email about the missing page to a webmaster.

Building a custom error page with PHP and Apache requires two steps. You need to tell Apache to run a PHP program when it encounters a 404 ("Page Not Found") error. And you need to write the corresponding program that takes the appropriate action.

http://www.onlamp.com/pub/a/onlamp/2003/02/13/davidsklar.html