You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Daniel Aleksandersen <al...@runbox.com> on 2008/04/08 16:05:10 UTC

[users@httpd] Comma and semicolon parameters for content negotiation

Hi,

Inspired by http://h3h.net/2007/01/designing-urls-for-multilingual-web-sites/#method-07 and http://h3h.net/2007/01/designing-urls-for-multilingual-web-sites/#method-08 I want to use commas and semicolons for content negotiation with mod_negotiatate.

mod_negotiate only support file extension based negotiation. Meaning it only understands to negotiate between [../resource.en.utf-8.html] and [../resource.de.iso-8859-15.xhtml] when requesting [../resource].

Ideally, what I envission is something like this: [../resource,en] that would be mapped to ../resource.en.utf-8.html].

More details on a permanent fix for this:
https://issues.apache.org/bugzilla/show_bug.cgi?id=44779

Anyhow, I want to use this today. So how can I start using comma separated options in URIs today when mod_negotiate only supports dot separated options/extensions? Some clever rewrite?
-- 
Daniel Aleksandersen

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Comma and semicolon parameters for content negotiation

Posted by Daniel Aleksandersen <al...@runbox.com>.
Tue, 8 Apr 2008 14:18:45 -0400, Joshua Slive:
> On Tue, Apr 8, 2008 at 10:05 AM, Daniel Aleksandersen
> <al...@runbox.com> wrote:
> > Hi,
> >
> >  Inspired by http://h3h.net/2007/01/designing-urls-for-multilingual-web-sites/#method-07 and http://h3h.net/2007/01/designing-urls-for-multilingual-web-sites/#method-08 I want to use commas and semicolons for content negotiation with mod_negotiatate.
> >
> >  mod_negotiate only support file extension based negotiation. Meaning it only understands to negotiate between [../resource.en.utf-8.html] and [../resource.de.iso-8859-15.xhtml] when requesting [../resource].
> >
> 
> No, MultiViews only does extension-based negotiation. With type-maps
> you can use whatever names you want. See:
> http://httpd.apache.org/docs/2.2/content-negotiation.html#negotiation

Sorry for using the wrong terminology. Thanks for clarifying. :-) What I want is ideally to use commas instead of dots with the multiviews option.

> >  Ideally, what I envission is something like this: [../resource,en] that would be mapped to ../resource.en.utf-8.html].
> >
> >  More details on a permanent fix for this:
> >  https://issues.apache.org/bugzilla/show_bug.cgi?id=44779
> >
> >  Anyhow, I want to use this today. So how can I start using comma separated options in URIs today when mod_negotiate only supports dot separated options/extensions? Some clever rewrite?
> 
> You can do this with type-maps or with mod_rewrite (although with the
> latter, you may need to do your own interpretation of the Accept-
> headers).

Would I have to create multiple type-maps, or can I spesify more resourses in one map? For example, would I have to have both [../resource.var] spesifying that the English version is at [../resource,en.var] and then have a map at [../resource,en.var] saying about the same thing? (I do negotiation for format, language, charset, and compression.)

> By the way, I think your bug report is off base. The actual name of
> the file on the file-system is irrelevant for the client.

No, it is just a different approtch to multiviews.
-- 
Daniel Aleksandersen

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Comma and semicolon parameters for content negotiation

Posted by Joshua Slive <jo...@slive.ca>.
On Tue, Apr 8, 2008 at 10:05 AM, Daniel Aleksandersen
<al...@runbox.com> wrote:
> Hi,
>
>  Inspired by http://h3h.net/2007/01/designing-urls-for-multilingual-web-sites/#method-07 and http://h3h.net/2007/01/designing-urls-for-multilingual-web-sites/#method-08 I want to use commas and semicolons for content negotiation with mod_negotiatate.
>
>  mod_negotiate only support file extension based negotiation. Meaning it only understands to negotiate between [../resource.en.utf-8.html] and [../resource.de.iso-8859-15.xhtml] when requesting [../resource].
>

No, MultiViews only does extension-based negotiation. With type-maps
you can use whatever names you want. See:
http://httpd.apache.org/docs/2.2/content-negotiation.html#negotiation

>  Ideally, what I envission is something like this: [../resource,en] that would be mapped to ../resource.en.utf-8.html].
>
>  More details on a permanent fix for this:
>  https://issues.apache.org/bugzilla/show_bug.cgi?id=44779
>
>  Anyhow, I want to use this today. So how can I start using comma separated options in URIs today when mod_negotiate only supports dot separated options/extensions? Some clever rewrite?

You can do this with type-maps or with mod_rewrite (although with the
latter, you may need to do y9our own interpretation of the Accept-
headers).

By the way, I think your bug report is off base. The actual name of
the file on the file-system is irrelevant for the client.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org