[thelist] XHTML File extension

liorean liorean at f2o.org
Tue Oct 21 12:43:37 CDT 2003


Rodrigo Galindez wrote:
> Hello list:
>   I'm making some xhtml web pages, and I wonder if I just can only use the .html extension for the files, or maybe a .xhtml extension would be better to use.
>   So, can anyone please tell me what are the advantages and disadvantages of using .xhtml instead of .html as file extension ? 

The file extension is inconsequential, except for users saving your file 
to disk. .html or .xhtml are as good as .png or .txt, what is important 
is that the Content-Type HTTP meader is set right. It should be 
"text/html;charset=us-ascii" (if you want to serve your files as HTML 
and have them coded in us-ascii) or 
"application/xhtml+xml;charset=uft-8" (if you want to serve your files 
up as XHTML/XML and have them coded in UTF-8). Or use the charset 
ISO-8859-15 (better choice than ISO-8859-1 for western latin - also 
called latin-1 - these days). Or send it as XML (text/xml, 
application/xml). Anyway, the file extension is irrelevant. It's just a 
name and has nothing to do with the actual file type, except that for 
sorting and perhaps conveience reasons .html would probably be best.

-- 
liorean <mailto:liorean at user.bip.net>

ViewStyles, ViewScripts, ToggleStyles and GraphicsInfo bookmarklets and 
Theme Switcher, Cookies Handler scripts:
<http://liorean.web-graphics.com/>



More information about the thelist mailing list