I just saw, via Intertwingly, that there is a complete book about Apache mod_rewrite. The book runs 160 pages.
The intertwingly post made mention of regular expressions, and so I went over to ASF to learn more about this irregular feat: Apache Module mod_rewrite.
The project description begins with:
This module uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly. It supports an unlimited number of rules and an unlimited number of attached rule conditions for each rule, to provide a really flexible and powerful URL manipulation mechanism. The URL manipulations can depend on various tests, of server variables, environment variables, HTTP headers, or time stamps. Even external database lookups in various formats can be used to achieve highly granular URL matching.
This module operates on the full URLs (including the path-info part) both in per-server context (httpd.conf) and per-directory context (.htaccess) and can generate query-string parts on result. The rewritten result can lead to internal sub-processing, external request redirection or even to an internal proxy throughput.
Here is a heads-up to the Apache team.
As soon as SPITBOL is ported to Linux then someone is going to take an afternoon or so and produce an updated mod_rewrite that runs about 100x faster. They may even write a book about their experience, though it will probably run to about ten pages or so.
You will then spend about ten years fielding complaints from the gazillions of users worldwide who will ask why you didn’t help port SPITBOL to Linux about, say, a decade or so ago.