Content last modified Monday 3 September 2018
hop to #bottom
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


Announcing error document support for TxP. This plugin provides a configurable hook for common (and custom) HTTP errors. Errors can be configured to display a specific article on your site, redirect to a URL, include a file or simply output text.

Currently the plugin supports two error codes, 403 Forbidden and 404 Not Found, more can easily be add. (Although this plugin was designed as a companion to sgb_url_handler it can be used by any plugin/hack.)

The plugin responds to each error code in one of four possible ways; by displaying an article on your site (ID), redirecting to an error page (URL), including an error document (file) or by simply outputting error text (text). The plugin responds to an error in the order specified above (ID, URL, file and text). If the ID is not set or is not found, the plugin will try the URL. If the URL is not set the plugin will try the file. If the file is not found, the plugin will output the text, defaulting to standard message if custom text is not set.

If an error code is passed to the plugin that is not under stood, the plugin will not do anything.

The id should be of an article available in your article database. You may wish set up a dedicated “Errors” section to prevent the errors articles from being listed with your normal posts.

The URL should be an absolute URL to a page explaining the specified error code. If this error is triggered users will be redirected to this page.

The file element should be a relative path (to index.php) to a file explaining a particular error code. The function will exit() immediately following the inclusion of the file (terminating any further TxP actions).

This text will be echoed to the browser, if it is not specified a default message will be displayed. This text can contained HTML code. The plugin will issue an exit() call immediately after echoing the text (terminating any further TxP actions).

After installing sgb_error_documents, click edit to change the configuration, all configuration options are listed in the first function.

Article Request Count:
Initially released:
Posted here:
14 Mar 2005

You know you want to visit the Archives.
Published with Textpattern