> pictools > doc > error
> pictools > doc > error
Pictools: Driver Pages
V3.3 (445)
error.php
/error.php
Response for obscure errors
usage, in php code:
    include "{$_SERVER['DOCUMENT_ROOT']}/error.php"; die();

(This page may be invoked directly from .htaccess: ErrorDocument)

These pictools files are all part of the error management tools:

.htaccess
When the RewriteRules in this file discover that an incoming URL refers to an existing page, that page is returned. Otherwise requests are sent to urlHandler. (If oddball, non-URLerrors occur, they are processed by this page (error.php) as described below.)
urlHandler
Employing numerous strategies--including the urlmap database--this page decides whether to return a page with mimetype:sendpage, return a picture with servepicture, redirect the request, return an apologetic error with box404, or deem the request to be web scum and relegate it to tarpit.
urlmap
This database lists the treatment for specific URL pefixes; for instance it maps /readme.txt to /pictools/INDEX.html. The actual treatments are the options entertained by urlHandler. The documentation of this database describes how I use badlinks.xlsx to decide what new urlmap entries are needed. As a result, Physpics accrues no more than a dozen bad URL requests per week.
box404
An apologetic error message inviting the user to search forth from the index.php page nearest to the request. This is the usual reaction to a missing page instead of the error page shown below.
command
The /admin/command page is only accessible from one ip address. It displays erroneous incoming URLs and offers a half dozen useful maintenance tasks.

Error.php

404 and 403 errors are generally handled by forPhyspics:pagefail, dirbar, and box404. For the rare other error, this page gets invoked. (Try teapot.html.)  Derived from Wordpress sample code, the code begins by extracting a few $AA_xxxxx variables. It logs the error to /admin/logs/urlerrors.log. Next it sets the status code in the header. Finally it displays this geeky page. Sample:

geeky error page

 
Copyright © 2023 ZweiBieren, All rights reserved. Feb 5, 2023 17:05 GMT Page maintained by ZweiBieren