E-mail List Archives

Serving XHTML correctly -- continued


From: James Pickering
Date: Jun 30, 2005 6:26PM

I will relate my own past experiences in insuring that I am serving my XHTML Web pages with the correct MIME-type of application/xhtml+xml .

Using the header Markup ..........

<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=us-ascii" />

.......... on a test XHTML page didn't do the job -- the Header output via http://www.web-caching.com/showheaders.html showed Content-Type: text/html in my Mozilla Firefox Browser. I called my Web Service Provider to inquire if their Server (Zeus/3.4) recognized MIME-type application/xhtml+xml . to associate with XHTML documents. The technician I spoke with informed me that only MIME-type text/html was recognized for association with HTML documents -- they were unwilling to modify their implementation and suggested I compose and load to the Server an appropriate .htaccess file to add MIME-type application/xhtml+xml to my directory -- he offered to walk me through the procedure, but I told him I had done this before and could proceed on my own. I did compose and load up to the Server the following .htaccess file ..........

AddType application/xhtml+xml html

..... That did the trick. I tested my exemplar XHTML 1.0 (strict) page http://www.jp29.org/indexx.html in http://www.web-caching.com/showheaders.html and the header showed Content-Type: application/xhtml+xml in my Firefox Browser. My ISO-HTML Home page http://www.jp29.org/index.htm showed (correctly) Content-Type: text/html in the same Browser. I have yet to test these pages using other Browsers (time constraints). BTW, I use the file extension .htm for my HTML pages and .html for my XHTML pages in order to use both MIME-types on my Server

http://www.wats.ca/resources/.htaccessandmimetypes/32 IMO is the very best reference and guide for those XHTML authors who wish to compose and load their own .htaccess file in order to add a required MIME-type .

James Pickering
Pickering Pages