PHPBUilder: Using PHP Error Handling | Linux Today

PHPBUilder: Using PHP Error Handling

Written By
Web Webster
Web Webster
May 20, 2000

[ Thanks to Kevin
Reichard
for this link. ]

“An all to common error on the web is broken links. You
end up with broken links from other sites whenever you rearrange
your site. People bookmark some page they like and come back 3
months later only to find a ‘404 Not Found’, giving them no help
whatsoever about where to start looking for the page you originally
had on your site. Let’s solve this, or atleast be friendly to
your users and help them get back on track whenever they hit ‘a
404’.
You can even create a common page to report all errors
you might encounter while rendering your pages.”

“PHP together with Apache gives you quite alot of freedom to
create your own error pages, but requires some reconfiguring and a
tiny bit of coding. Let’s start off with the configuration part.

“The Apache ErrorDocument directive specifies what document (or
URI) Apache should redirect a user to in case of an error. It
allows you to specify one resource for each and every error code
one of your users might run into. Start off by adding a
ErrorDocument 404 /error.php directive to your server
configuration. This will redirect users that ask for a page that
does not exist to the ‘error.php’ page you will soon write. Don’t
forget to restart Apache for the changes to take effect. “

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.