httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Scoffier <>
Subject [users@httpd] still content negotiation problems
Date Mon, 13 Jun 2005 19:39:36 GMT

I am stuck, I've read a lot of docs, and still it doesn't work.

I am trying to set up a site which will serve pages in french and
english.  I have read the pages at

And the gmane.comp.apache.user archive of this list, and still my server
refuses to play nice, or the heat is making me stoopid...

What I have done so far (I was thinking of making a little toot cause
the documentation sure is lacking):

I'm using OpenBSD's apache (which does not have many "standard" modules

  compiled mod_negotiation and mod_mime (which I am not 100% sure is needed):
    cd /usr/scr/usr.sbin/httpd/modules/standard
	apxs -i -a -c mod_negociation.c
	apxs -i -a -c mod_mime.c

apxs which I haven't used before puts the modules in
/usr/lib/apache/modules and adds the two LoadModule lines to
/var/www/conf/httpd.conf cool.

LoadModule negotiation_module /usr/lib/apache/modules/
LoadModule mime_module        /usr/lib/apache/modules/

(are there other modules I need ?)

    apachectl configtest 
    Syntax OK 

Haven't broken anything good.  Now for httpd.conf :

I want to keep much of the old site working.  If there was an index.html
version and there is no french version I would like index.html sent to
the browser.  If there is a I would like the negotiating
to happen sending the correct page depending Accept-Language header sent
out by the browser.  Seems that I have to then change the english
index.html to index.html.html and the french to
As per:

<VirtualHost *>
        DocumentRoot /var/www/htdocs/langnego
        ErrorLog /var/www/logs/
        CustomLog /var/www/logs/ "%h %l %u %t \"%r\" %s %b \"
%{User-agent}i\" \"%{Accept-language}i\""

<Directory /var/www/htdocs/langnego/ >
        Options +MultiViews
        AddLanguage fr .fr
        AddLanguage en .en
        LanguagePriority fr en
        DirectoryIndex index

Here's my directory structure (you can test at ):

$ ls /var/www/htdocs/langnego/     index.html.html      test.html.html

I set my browser to prefer fr which I can tell from the custom log (see below)
the default directory returns the english page.  A request for test.html
returns a 404, and just when you thought +MultiViews wasn't working a request
for test returns the english text.html.html .  When I go to I get
their french page correctly... - - [13/Jun/2005:15:44:30 -0400] "GET / HTTP/1.1" 200 17 "Mozilla/5.0 (X11;
U; Linux i686; en-US; rv:1.7.8) Gecko/20050514 Firefox/1.0.4" "fr,en;q=0.5" - - [13/Jun/2005:15:44:38 -0400] "GET /test.html HTTP/1.1" 404 215 "Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050514 Firefox/1.0.4" "fr,en;q=0.5" - - [13/Jun/2005:15:48:07 -0400] "GET /test HTTP/1.1" 200 17 "Mozilla/5.0 (X11;
U; Linux i686; en-US; rv:1.7.8) Gecko/20050514 Firefox/1.0.4" "fr,en;q=0.5"

Thanks for any tips,


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message