This is a discussion on Re: 2.0.47 problem; content negotiation fails to use language pages (.en) within the Linux Web Servers forums, part of the Web Server and Related Forums category; * Jem Berkes wrote: > This is a very strange problem, which I've seen mentioned on the newsgroups > but ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
* Jem Berkes wrote:
> This is a very strange problem, which I've seen mentioned on the newsgroups > but not resolved. > > I noticed it because the apache manual pages loaded fine with 2.0.46. I > just compiled and installed 2.0.47 from source (as I had done with 2.0.46) > using the same httpd.conf, and now I have a new problem. The only > difference in how I compild 2.0.47 was I used the --enable-deflate option. The documentation configuration was changed in 2.0.47. Just c&p the docs configuration block from the default httpd.conf. nd |
|
|||
|
>> I noticed it because the apache manual pages loaded fine with 2.0.46.
>> I just compiled and installed 2.0.47 from source (as I had done with >> 2.0.46) using the same httpd.conf, and now I have a new problem. The >> only difference in how I compild 2.0.47 was I used the >> --enable-deflate option. > > The documentation configuration was changed in 2.0.47. Just c&p the > docs configuration block from the default httpd.conf. Thanks! That's done the trick. Now I'm wondering what this does: DirectoryIndex index.html.var I thought that apache would server the appropriate language if index.html.LANG-CODE existed, I guess there's more to the setup than this if one wishes to serve such a multilingual index? |
|
|||
|
* Jem Berkes wrote:
>> The documentation configuration was changed in 2.0.47. Just c&p the >> docs configuration block from the default httpd.conf. > > Thanks! That's done the trick. > > Now I'm wondering what this does: > DirectoryIndex index.html.var > > I thought that apache would server the appropriate language if > index.html.LANG-CODE existed, I guess there's more to the setup than this > if one wishes to serve such a multilingual index? Depends :) DirectoryIndex index.html.var (defined document root for the "successfully installed" default page) lets apache look for such a file if one requests a directory (http://example.com/). .var refers to a type-map (there's a AddHandler type-map .var somewhere else), which contains the descriptions of the different variants. mod_negotiation picks up that type-map handler and delivers the variant of choice then. However, one doesn't *need* to use explicit type-maps. Apache can create (limited) ones on the fly. That is what Options +MultiViews is for. If this option is set, mod_negotiation jumps in if the requested file was *not* found. For example, someone requests foo.html but there are only files like foo.html.en foo.html.fr or even foo.html.ja.jis It now creates such a type-map on the fly and selects the appropriate variant. In order to know, that foo.html.en stands for English, you have to configure that. This is done using AddLanguage directives, e.g. AddLanguage en .en AddLanguage fr .fr AddLanguage ja .ja The latter has also the extension .jis, which is also defined somewhere: AddCharset iso-2022-jp .jis which means then, this file will be delivered if the browser accepts (a) language ja and (b) the iso-2022-jp charset. There are, however, more negotiation dimenensions than language or charset. This was only a short abstract of that what the httpd-docs explain. Just have a look into negotiation docs, like: <http://httpd.apache.org/docs-2.0/content-negotiation.html> ----- The docs trick a bit, since they do define type-map files, but don't name them ..var but .html (just look into such a file :). Additionally they make use of a new mod_negotiation feature, which allows for selecting a language per request, independent from the browser's Accept-Header. HTH, nd |