RewriteMap

This evening I finished writing Chapter 5, which is about RewriteMap. In the process, I puzzled over some things in the docs, fixed a small number of them, and planned to fix a larger number of them. Hopefully I’ll spend the two days of the Hackathon at ApacheCon working 0n that.

Anyways, for some time, I’ve admired the fact that you can go to a URL like http://php.net/echo and get the docs for the echo command. It appears simple enough, but actually involves some work to make it happen like that. Kudos to them, however, it’s being done.

I want the same thing for the Apache docs, and, of course, I wanted to accomplish it with features that are built into the Apache web server product. Part of that is just hubris, but there’s slightly more to it than that. In particular, I’d like to have the feature available to anyone who’s running a mirror of the website, without their having to install and configure anything extra.

Well, I’m almost there, using mod_rewrite and RewriteMap, with dbm map files. There’s a few steps here. Eventually, one hopes, we’ll have this enabled on httpd.apache,org, but, for now, it’s at fajita.drbacchus.com/DirectiveGoesHere

So, for example, if you want the docs for RewriteMap, you go to fajita.drbacchus.com/RewriteMap.

Strangely, the bit that caused me the most work was getting it to be case insensitive. Turns out that the first thing I tried was correct, but that I had another directive that was overriding it, and hiding the fact that it was correct. Bah.

For more details on exactly how it worked, buy my book and read chapter 5. 😉 (Seriously, though, I’ll write it up somewhere if anyone cares.)