Apache language negotiation fallback problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Web Servers on Unix and Linux > Apache language negotiation fallback problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Apache language negotiation fallback problem  
Victor Engmark


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-20-04 12:47 PM

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"





[ Post a follow-up to this message ]



    Re: Apache language negotiation fallback problem  
Alan J. Flavell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-20-04 12:47 PM

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.






[ Post a follow-up to this message ]



    Re: Apache language negotiation fallback problem  
Victor Engmark


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-20-04 12:47 PM

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"





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:32 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register