Web Servers on Unix and Linux - Apache language negotiation fallback problem

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > August 2004 > Apache language negotiation fallback problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache language negotiation fallback problem
Victor Engmark

2004-08-20, 7:47 am

I have a web page built using files like index.php.en and index.php.no.
The core of the problem is that language negotiation doesn't seems to
work. When the client doesn't accept neither English nor Norwegian, the
"406 Not Acceptable" page shows up. I thought I could avoid this by
creating a symlink called index.php to index.php.en, but then clients
which prefer Norwegian will never show index.php.no (I've tested on IE
and FireFox). What am I doing wrong?

The web site is at http://www.ntnu.no/~engmark/, and server information
can be found at http://www.ntnu.no/~engmark/phpinfo.php.

--
Victor Engmark
"If you keep an open mind people will throw a lot of garbage in it"
Alan J. Flavell

2004-08-20, 7:47 am

On Fri, 20 Aug 2004, Victor Engmark wrote:

> I have a web page built using files like index.php.en and
> index.php.no. The core of the problem is that language negotiation
> doesn't seems to work. When the client doesn't accept neither
> English nor Norwegian, the "406 Not Acceptable" page shows up. I
> thought I could avoid this by creating a symlink called index.php to
> index.php.en, but then clients which prefer Norwegian will never
> show index.php.no (I've tested on IE and FireFox). What am I doing
> wrong?


If your server is Apache 2.0, then read its documentation - this is
solved without additional work on your part (take away your symlink).

If your server is Apache 1.3 then there is a workaround suggested in
my tutorial http://ppewww.ph.gla.ac.uk/~flavell/www/lang-neg.html

Read especially the sub-heading "The Status 406 Language Dilemma", and
then the heading "Use of Apache MultiViews".

This works well with "html" (you need to call the symlink
index.html.html , instead of just index.html). I didn't try it with
php, but maybe you can try index.php.php or index.php.html or such?

Or change your href="whatever.php" into href="whatever" , and leave
Multiviews to supply the extension.

Victor Engmark

2004-08-20, 7:47 am

Alan J. Flavell wrote:
> On Fri, 20 Aug 2004, Victor Engmark wrote:
>
>
>
>
> If your server is Apache 2.0, then read its documentation - this is
> solved without additional work on your part (take away your symlink).
>
> If your server is Apache 1.3 then there is a workaround suggested in
> my tutorial http://ppewww.ph.gla.ac.uk/~flavell/www/lang-neg.html
>
> Read especially the sub-heading "The Status 406 Language Dilemma", and
> then the heading "Use of Apache MultiViews".
>
> This works well with "html" (you need to call the symlink
> index.html.html , instead of just index.html). I didn't try it with
> php, but maybe you can try index.php.php or index.php.html or such?


The server is Apache 1.3. Creating a link called index.php.php worked
just fine. Thanks! Now the MF task is to get a working bash script to
create links in all directories. *sigh*

> Or change your href="whatever.php" into href="whatever" , and leave
> Multiviews to supply the extension.


--
Victor Engmark
"If you keep an open mind people will throw a lot of garbage in it"
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com