httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Aleksandersen <>
Subject [users@httpd] mod_negotiation: prefer-type cookie? (as prefer-language)
Date Mon, 03 Mar 2008 22:53:14 GMT
On 2008-03-03, Joshua Slive wrote:
> On Mon, Mar 3, 2008 at 1:05 AM, Daniel Aleksandersen
> <> wrote:
> > Hi,
> >
> >  Taken from the example were the Accept-Language (and it qualifiers)
> > HTTP header is overridden by a cookie set in the user's browser; from
> > :
> > SetEnvIf Cookie "lang=(.+)" prefer-language=$1 Header append Vary
> > cookie
> >
> >  But can this be done with the Accept HTTP header as well? Is there
> > an environmental variable that can be used to override the default
> > negotiation method for the Content-Type as well? I had visioned
> > something like the below, but I have not found anything in the
> > documentation. SetEnvIf Cookie "type=(.+)" prefer-type=$1 Header
> > append Vary cookie
> >
> >  If this is an undocumented or unsupported feature… How can I achieve
> > the same result using other approaches? Basically I want to offer the
> > user a way to override the default content negotiation method. Like
> > with the prefer-language option.
> No, there is no similar environment variable to override type
> selection.
> If you don't need full content negotiation -- that is, you are able to
> boil your selection algorithm down to a few simple rules and you don't
> need to worry about preference priorities, etc -- then you can use
> mod_rewrite to do this based on the Accept header and the cookie.

So I cannot achieve this using the content negotiation module? That is a 
shame. I do rely on the preference priorities, and how mod_negotiation 
resolves local file names and URIs.

If I somehow knew that one magical regex that would deal with preference 
priorities and language handlers just as good as mod_negotiation… Then I 
could replace it. Hehe.

…or maybe it is possible to check for a cookie, and if that fails (meaning 
no override) than the mod_negotiation process would start. I have no idea 
how this would look in a .htaccess file.

What I am looking for is way to respect the user’s wish to consistently 
override their browser’s preferences. The ugly fix is to link directly to 
the file. But that will cause problems with the languages. :-/
Daniel’s open source notebook –

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message