You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Alexei Kosut <ak...@organic.com> on 1996/08/08 01:06:19 UTC
mod_browser
I've uploaded to /httpd/incoming/mod_browser.c, with documentation in
mod_browser.html, a module that implements functionality that we've
discussed here before, and that has generally been agreed to be a useful
addition to the Apache distribution.
This module sets environment variables based on the User-Agent string.
These are then available to CGI scripts, or includes, or what have you.
This is done using regular expressions, e.g.
BrowserMatch ^Mozilla/[2-3] tables javascript
would set the variables "tables" and "javascript". It sets them to "1"
unless otherwise specified (e.g. "variable=value").
This lets you do several things. For one, it lets you modify Apache's
behavior based on the User-Agent. For example, we could throw in an
"!table_get(r->subprocess_env, "nokeepalive")" into the keepalive code,
andthen do "BrowserMatch ^Mozilla/2.*Win nokeepalive" (or whatever). This
is something we discussed earlier.
The other important thing, and perhaps the most obvious, is that it gives
Apache, when combined with xssi, an out-of-the-box solution to
feature-based conditional HTML. Which is something people seem to want.
Thoughts?
-- Alexei Kosut <ak...@organic.com> The Apache HTTP Server
http://www.nueva.pvt.k12.ca.us/~akosut/ http://www.apache.org/