Baby steps

Mark Pilgrim has updated his site based on recommendations from Ian Hickson on building a perfect Web log. Following some of their lead, I’ve added the first bit of browser checking to my site using Apache’s mod_rewrite. The module has always scared me, but using what amounts to an identity rewrite I’ve managed to dynamically change the MIME type returned for my weblog pages. Here’s how it works.

RewriteEngine on

This line turns on the rewriting engine for the current directory and all subdirectories below it.

RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[5-9].* [OR]
RewriteCond %{HTTP_USER_AGENT} ^Amaya/[5-9].*

These two lines define the conditions where the following rule will apply. They look at the HTTP_USER_AGENT variable (i.e. the User-Agent: field in the HTTP request) and check that it begins with Mozilla/ or Amaya/ followed by a major revision that is known or presumed to support the correct MIME type for XHTML files. (I’m working under the assumption that if it’s supported in an earlier version it will continue to be supported in a later one.)

RewriteRule ^(.*)\.html$ - [T=application/xhtml+xml]

Finally, I add the rule itself: any file that has the extension .html gets mapped to exactly the same name. By itself that’s useless and just wastes cycles on each request… except for the T= field that resets the MIME type, which was the original goal.

Easy peasy.

Right now, all of these lines are in a .htaccess file in the weblog directory. If/when I update the rest of the site to a version of XHTML (most of it has been, but I’m not confident enough to switch completely yet), these rules will migrate to my global httpd.conf.

Sundries

Responsible

Above all others, there are five people to be held responsible for my having any delusions of having the ability to write.

  • Robert Enns.
  • John Burke.
  • Colette Smith.
  • My parents.

All five of the above are teachers; the first three are specifically English teachers, and the latter two teach French, Spanish and other languages. More on all of them another time.

I’ve been finding it hard to update here regularly, but my desire to write has been rekindled by my friend Kym, in various different ways. Thanks Kym!

Taxonomy

I think it’s time for two new categories, Personal and Writing, but I don’t want to call them by those names. I’m now accepting suggestions for pithy quotations for each category and a short excerpt for the name. (Even I found Of all those arts in which the wise excel, Nature’s chief masterpiece is writing well–category title Nature’s chief masterpiece–from the Duke of Buckinghamshire Sheffield’s Essay on Poetry too pretentious for my little chunk of cyberspace.)

Come together

SONICblue and TiVo have dropped their mutual patent infringement lawsuits: We believe our energies are better spent expanding the market for Digital Video Recorders (DVRs) rather than fighting each other… the overall success of the DVR category is what is most important to the companies at this time.

I was all ready to post some snarky comment about how DVR will never go anywhere because the competitors just aren’t partisan enough, but my heart’s just not in it. Instead, bravo to two companies who recognize that cooperation can be more productive than litigation.

Not gonna do it

For those who’ve asked, only one thing last Friday was work-related. (And thanks much for all the kind words.) I’ve stayed away from posting about goings-on at my place of employment, not because they’re particularly bad (they’re not, unless you look at the stock price) or uninteresting (they are… and I’m aware that that can be interpreted a couple of ways) or because it’s against some sort of policy (it’s generally not, as long as I don’t discuss what I’m making), but basically because this is a place that I don’t post about work.

Circular logic… you know, for kids!