httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Malo>
Subject make mod_negotiation more configurable
Date Wed, 22 Jan 2003 01:55:18 GMT
I'm planning to apply some request dependent extensions to mod_negotiation. 
The first is ready-to-commit :) but I'd like to hear some comments about 
them in general.
The main goal is to make some configuration cases more simple.

The attached patch (mod_negotiation.c.patch) introduces a new special 
variable "prefer-language" which influences mod_negotiation in that way, 
that it first tries to select only variants that have the specified 
language tag. If no success, it tries negotiation again with all variants.
A more readable patch (without the addional indentation) is also attached.

This allows, however, cool configurations like the following:

AliasMatch ^/manual(?:/(?:de|en|ja|pt-br|ru))?(/.*)? \

<Directory "/path/to/manual">
  [...normal stuff...]

# would be nice, but isn't supported yet:
#    SetEnvIf Request_URI ^/manual/(de|en|ja|pt-br|ru)/ \
#               prefer-language=$1

    SetEnvIf Request_URI ^/manual/de/    prefer-language=de
    SetEnvIf Request_URI ^/manual/en/    prefer-language=en
    SetEnvIf Request_URI ^/manual/ja/    prefer-language=ja
    SetEnvIf Request_URI ^/manual/pt-br/ prefer-language=pt-br
    SetEnvIf Request_URI ^/manual/ru/    prefer-language=ru

As you may guess, it would be very useful for the distributed documentation 
(there are/were already some discussions about the problem). So I'd also 
propose a backport to 2.0.

The next step would be to make mod_negotiation recognize "no-gzip" and 
"gzip-only-text/html", too. In fact, I had an early patch for that (which 
dropped encoded variants entirely from the list), but I think, if it's 
implemented similar to the "prefer-language" code, it's much better.

Any comments, suggestions or objections?
If not, I'm going to commit the stuff :)

Flhacs wird im Usenet grundsätzlich alsfhc geschrieben. Schreibt man
lafhsc nicht slfach, so ist das schlichtweg hclafs. Hingegen darf man
rihctig ruhig rhitcgi schreiben, weil eine shcalfe Schreibweise bei
irhictg nicht als shflac angesehen wird.       -- Hajo Pflüger in dnq

View raw message