What is it?: A way to make a custom 404 error page for an Apache web server (or any web server that uses a .htaccess file.
Why would I care?: With this methode your logo, adds, menu, etc loads when someone goes to a broken link on your site. So, even though they get an error, they get your adds and menu instead of the default error page that most web browser's display.
First, add this line to your .htaccess file:
Code
<br />ErrorDocument 404 /error.php <br />
Next, edit my error.php file adding your comments between the paragraph tags. If your Threads install is in a directory named ubbthreads under web root then there is no need to edit the line that requires the library. Otherwise you'll have to change the path to main.inc.php as well.
The error pages have been placed into a specific directory "errorpages" of their own. I went and used .threads send_header/send_footer and placed the error page names into the language files for "online.php" so that I can see what errors are occuring live. (well almost live)
to the /ubbthreads/languages/english/online.php file right after I made my post
Most of the errors I get are 404 (file not found) because I moved all my articles over to Threads, and the old site was rated very high in all the search engines.
I rarely see any errors other than 404's as well but once in a while you'd be surprised. I haven't looked but does your error page allow the viewer to send the webmaster a notice about the error? I also have my own error pages redirect to the index after 10 seconds.
One caution though. I used Dave's advice and added all the page error codes. However any one that has banner ads for sponsor's might want to not include the following error pages as this will break an otherwise working link.
The page looks wonderful but you could be better off with removing the email address to the webmaster and replacing it with some sort of a hybrid of Josh's Contact Us form, to avoid spam spiders. Usually spiders will query the server for a 404 and grab the webmasters address...
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.