So your surfing the web and you end up seeing something like 404 Page not found. The average user is likely to say, "wtf teh suxorz 111". This means as a web developer you should know what the error codes are so you can fix them, and explain to your users what they mean in simple terms. Scary enough most error codes should be hidden from users and instead replaced with busy messages. This tactic is used by professionals to save face while buying some time to fix the problem from the user.
One easy way to handel errors is to use .htaccess files under apache, or a script to email the webmaster incase there is a broken link. Acctually logging is better though since email messages will clog your webmasters inbox quickly if you have a respectable number of users on your site.
The easiest and most common use of error handeling is .htaccess 404 for redirection to either a static or dynamic page, i.e.:
ErrorDocument 404 errors/404.html ErrorDocument 404 errors/404.shtml ErrorDocument 404 cgi-bin/errors.cgi?err=404 ErrorDocument 404 error404.php
Another way of redirection under apache is via http rewrite rules? This is also easy. The following line can be used to redirect every not found URL to a different server/domain:
RewriteEngine on RewriteCond \%{REQUEST_FILENAME} !-f RewriteRule (.+) http://404.click11.com/$1
Yet another way of redirection under apache is via a per domain configuration using one of the above methods. Simply put, open your virtual host file for a given domain and use one of the above solutions to use an improved way of error trapping.
What about server side programs? Most server side programs should have built in error handeling. They can use the following line at near the top of their code for perl based programs to display what is wrong with the code.
Help Im using IIS and not Apache, is there a .htaccess equivelent in IIS? Yes there is a .htaccess equivelent in IIS!
This is a list of error codes so you can make pages that express in a meaningfull way to the user what happened.
Do you get problems viewing your pretty error pages now? Well this is actually probably a result of Microsoft trying to steal traffic from websites using their own "freindly" error handeling instead of yours. To turn off this feature go to the following in Internet Explorer: Open IE --> (menu) Tools --> Internet options --> Advanced --> (uncheck) show friendly HTTP error messages