httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] How do I follow the XHTML Content-Type recommendations?
Date Fri, 17 Jul 2009 20:31:00 GMT wrote:
> If a client requests an XHTML file, it says to do normal
> content-negotiation.

No, if a client asks for the URL "/abc/file.html", it wants the resource 
corresponding to that URL.

   If the client's HTTP Accept header says they like
> text/html more, send them that.
/This/ is where content negociation starts, /if/ the server happens to 
have more that one representation of the requested resource available.
The client indicates a /preference/ for one or the other representation 
of the resource, /in case/ the server has several.

   If it says they like application/xhtml+xml
> more, ... (and if we have it) ... send them that.

kind of, but it's either, or.

> Fine.  I have even done that successfully with two different files.
> Except I can't figure out how to provide multiple Content-Types for a
> single file.

Logical, because you can't.  One document/file has only one MIME type, 
not several.

Unless you mean what is described here :
(Read it, don't just guess how it works)

The server /tries/ to find the alternative file which matches the client 
preferences best.  Once it finds it, it will send /that/ file, with the 
MIME type of /that/ file in the Content-type header.

   And I don't think creating multiple copies of the document
> (even with linkes) is an appropriate solution.
>    AddType "application/xhtml+xml,text/html; qs=0.01" .html

What makes you think that you can do that ?
Not this :
The first argument to the AddType directive is /one/ MIME media type, 
not several, and no parameters.  The following argument(s) is a list of 
possible extensions.

> Tells the client "Content-Type: cation/xhtml+xml,text/html; qs=0.01",
> which is no good.

No, and it's even invalid.
See, 3.7 & 14.17

Content-type: text/html; charset=UTF-8
is a valid header, the above is not.

> An apache type-map always returns the Content-Type specified by AddType in
> my main apache config file.

I believe you are a bit confused.
Your typemap file has the same mistake.

Because of that, your later tests do not make much sense.

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