Readme.txt from the package:
Add an Apache Error Handler to SMF
Version: 1.0 Date: 2008-08-30
Compatibility: SMF 1.1.5, SMF 2.0 Beta 3.1 or later
This modification adds to SMF the capability to intercept all Apache errors such as 'Error 404 - Not Found' and the like, and displays an error message to your members using your familiar forum format. It also adds error entries to SMF's error log so that you can see and investigate the errors.
There is an important matter that every hosting customer should understand. Hosting services provide default error pages if the customer does not supply their own. For example, my SMF test forum domain has the word 'dog' in its domain name, I guess because I'm fond of the critters. Without my custom error page I get a default hosting service error handler that they use for parked domains. They must have sensed the word 'dog' in my domain name because they serve up a page of suggestions for other domains that might have what the site visitor is looking for. In my case the Error 404 page has suggestions for dog food, vetenarians, dog informational sites, etc. Ask yourself this question: Are you willing to take the chance that your hosting service will send your forum members to competing services including competing forums whenever there is a site error?
- Intercepts Apache errors 400-417, 500-505
- Supplies a user message indicating error type and description
- Logs the errors in SMF's error log including error URL
- Provides a seamless integration between Apache error messages and SMF
- Automatically configures your .htaccess file
Note: The modification will work only on servers with Apache installed.
Please back up your index.php and .htaccess files before beginning the installation. Automatic deinstallation almost always succeeds but it never harms to be prepared for the worst.
The modification automatically adds directives to your .htaccess file if one is present, or creates a new .htaccess file otherwise. Any existing .htaccess file is renamed .htaccess~ for a backup after its contents have been added to the new .htaccess file. Uninstalling the modification restores your old .htaccess file if one was present, or removes the modification's .htaccess file otherwise. If you delete the backup file the modification will attempt to remove its directives from whatever .htaccess file it finds, or does nothing to the file if the modification's directives cannot be safely removed.
The .htaccess file is installed in your board directory whether it is '/' or '/forum/' or whatever your called it. If your forum is installed in e.g. '/forum/' and you would like your SMF to handle errors from the entire domain (such as including your portal) you can copy the .htaccess file to your '/' folder. Uninstallation will not remove any copied file so you will have to manually delete it if you uninstall the modification.
Note 1: If you already have a 'RewriteEngine on' directive, the modification still adds its own. Multiple instances of the directive will harm nothing, and your directive will still be there if you uninstall the modification.
Note 2: Please understand that Error 500 Internal Server Error is internally generated by Apache when it is unable to handle a request for any reason. This occurs before your error handler can be called so it is unlikely that you will ever see an Error 500 display or log entries. It is not possible to intercept Error 500 under normal circumstances so this is not a failing of the modification.
Use SMF's package installer to remove the modification.
Note: If desired, the included UpdateHtaccess.php file can be run stand-alone in your board directory to modify or demodify your .htaccess file. Use 'UpdateHtaccess.php' to install the .htaccess file changes. Use 'UpdateHtaccess.php?uninstall' to remove the .htaccess file changes. Or alternately, you can just manually edit or delete your .htaccess fie.
You may get support or submit questions and comments in the modification's support thread at the SMF site.[/hr][/hr][/hr][/hr][/hr]