Forum Moderators: phranque

Message Too Old, No Replies

Content negotiation serving wrong language

Accept-Language not being properly interpreted

         

nafmo

6:42 pm on Sep 10, 2009 (gmt 0)

10+ Year Member



Hi!

I am having a problem with Accept-Language and Apache 2.2.9 (Debian):

In my .htaccess file, I have this content negotiation setup:

DirectoryIndex index
Options MultiViews ExecCGI FollowSymLinks Includes Indexes
AddLanguage sv .sv
AddLanguage no .no
AddLanguage en .en
AddLanguage nb .nb
LanguagePriority sv en no nb

And for the default document I have CGI scripts that I include a language code in, plus a generic script pointing to my default language:

$ ls -gG index.*
lrwxrwxrwx 1 12 10 sep 19.38 index.cgi -> index.sv.cgi*
-rwxr-xr-x 1 113 4 nov 2003 index.en.cgi*
-rwxr-xr-x 1 113 10 sep 19.31 index.nb.cgi*
-rwxr-xr-x 1 113 18 feb 2005 index.no.cgi*
-rwxr-xr-x 1 113 4 nov 2003 index.sv.cgi*

I recently added "nb", and now everything calls the "nb" script. Both with an Accept-Language of just

sv
as well as a more complex one with
sv,nb;q=0.9,no;q=0.8,da;q=0.7,nn;q=0.6
.

Does anyone have any idea on what is going on here? If I remove the "nb" language set up and all *.nb.* files, everything works as expected.

jdMorgan

7:28 pm on Sep 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please provide examples of more than one linked URLs that would be clicked and resolve to any of your "index.cc.cgi" files. To comply with our TOS, please use example.com if you need to refer to a domain.

Jim

nafmo

6:53 am on Sep 11, 2009 (gmt 0)

10+ Year Member



The index.cc.cgi are used as index files for the directory, so I visit
http://example.com/directory/
and Apache resolves it to the correct index.cc.cgi file. Normally, this works fine, but with "nb" added, it always resolves to the "nb" version, for some reason.

Perhaps "nb" is already registered as a handler for something else?

jdMorgan

2:23 pm on Sep 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Strange...

I suppose you could try using the RemoveType and RemoveHandler directives to "clear" any such registration -- at least as an experiment to test out this theory.

Jim