You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brad Nicholes <BN...@novell.com> on 2002/11/25 22:00:36 UTC

Language negotiation...

    If I explicitly request the page /index.html and that page does not exist, shouldn't Apache respond with one of the language versions of the page?  Currently on NetWare anyway, I can request / and get back whatever language version of index.html  my browser supports.  But if I specifically request index.html I get back "page not found".  How is this suppose to work?

Brad

Brad Nicholes
Senior Software Engineer
Novell, Inc., the leading provider of Net business solutions
http://www.novell.com 


Re: Language negotiation...

Posted by André Malo <nd...@perlig.de>.
* Brad Nicholes wrote:

> If I explicitly request the page /index.html and that page does not exist,
> shouldn't Apache respond with one of the language versions of the page? 
> Currently on NetWare anyway, I can request / and get back whatever language
> version of index.html  my browser supports.  But if I specifically request
> index.html I get back "page not found".  How is this suppose to work?

er, what is DirectoryIndex and what files are there in the directory?
do you mean the "hello" startup page? it's actually index.html.var with
DirectoryIndex index.html index.html.var

Options +MultiViews should work, but not very efficient in that case...

nd
-- 
sub the($){+shift} sub answer (){ord q
        [* It is always 42! *]       }
           print the answer
# André Malo # http://www.perlig.de/ #

Re: Language negotiation...

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 25 Nov 2002, Brad Nicholes wrote:

>     If I explicitly request the page /index.html and that page does not
>     exist, shouldn't Apache respond with one of the language versions of
>     the page?  Currently on NetWare anyway, I can request / and get back
>     whatever language version of index.html my browser supports.  But if
>     I specifically request index.html I get back "page not found".  How
>     is this suppose to work?

I'm guessing you are talking about the docroot of the default
distribution.  If so, note that we have
DirectoryIndex index.html index.html.var
and no Multiviews.  So when you request "/", apache checks
for index.html, doesn't find it, and goes on to look for index.html.var.
index.html.var triggers the negotiation.  When you request "index.html",
it doesn't look at the DirectoryIndex directive, and so it stops with the
404 at index.html.

The easy way to fix this is to simply add
Options +MultiViews
to the directory.  Then apache will check for index.html.* if you request
index.html and no exact match exists.  We don't have this in the default
config because MultiViews is an expensive and potentially dangerous option
if not used carefully.

Joshua.