httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject Re: mod_browser
Date Thu, 08 Aug 1996 10:24:47 GMT

>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?

Sounds good. I've been doing the tables example already with xSSI and
mod_env. Setting an env var to hold a list of browsers that don't handle
tables and then using xSSI to do the regexp to decide on tables or
table-free HTML.

It sounds like "BrowserMatch" would make a good start on a 
robot/indexer detector...  give it a list of all the 
robot USER_AGENT keywords (Crawler/NetCarta/Spider/...) and then
mod_reject_robots will be easier to write.


rob
-- 
Rob Hartill (robh@imdb.com)
The Internet Movie Database (IMDb)  http://www.imdb.com/
           ...more movie info than you can poke a stick at.

Mime
View raw message