Re: How do I follow the XHTML Content-Type recommendations?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Darxus@xxxxxxxxxxxxxxx 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 :
http://httpd.apache.org/docs/2.2/content-negotiation.html
(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 :
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addtype
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 http://www.faqs.org/rfcs/rfc2616.html, 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.
Re-read
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addtype

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:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux