View Full Version : XHTML specification on file names?
06-13-2005, 05:49 PM
I read a post elsewhere in which the author said that the XHTML Specification (http://www.w3.org/TR/xhtml1/) requires HTML pages to be saved with the suffix .html rather than .htm -- but I can't find anything in the specification about file names at all. Anyone know whether this is true?
06-16-2005, 03:36 PM
I'm no expert, but it does not make sense at all to me.
First of all xhtml should have nothing to do with filenames. It is a URL you are calling and that does not require any such thing as a file extension. Because, it does mat some Universal Resource Locater (URL) into some data response, which can come from a database as well as it can be mapped into a file system tree of *.html files, or into a set of script files i.e. *.php
To the contrary it is wise practice to stay away from extensions as part of the URL. It is better to define the URL name space as http://www.example.com/a-dir/first-page rather than http://www.example.com/a-dir/first-page.html. Because, it allows you to change the technology behind the scenes without changing the URL space (i.e. re-implement your site based on a PHP based CMS). By the way http://www.example.com/a-dir/ (notice the "/" at the end) would be shorthand for give me a directory listing of "a-dir" if this is allowed in the URL space. How this is handled is configured by the web-server (default on most servers is to serve the file http://www.example.com/a-dir/index.html).
I hope that answers the question.
06-19-2005, 06:01 AM
The reason is that some servers will not recognize .htm, only .html.
06-19-2005, 11:30 AM
which servers would that be?
Are you talking about hosting companies and how they configured their servers (or left them at their defaults)? Or are you saying some server software packages, can't serve *.htm files?
ADAM Web Design
06-19-2005, 11:42 AM
He's saying that some server packages are configured not to host .htm files by default (and in some cases, .html). This is hosting company/server-dependent and has nothing to do with XHTML.
.xhtml extensions, on a lot of servers, are also acceptable. So it can't be a length issue, since XHTML is longer than HTML.
XHTML is a coding standard, not a file-naming convention.
It's a bit of a moot point for me, however, since I do everything in ASP anyway. But if I were to guess, I would suggest that .htm would make the most sense if only for the reason that it's consistent with the other *.3 file types that are available for online use (.jpg, .gif, .asp, .php, .xml, etc.)