.htm and .html

liunx

Guest
What is the difference between .html and .htm? I first just learned that you can save Word documents in HTML so I played around with it tonight - it was great! But when I uploaded it to my server, it showed up as an .htm extension and the page would not load - even if it was named with the .htm extension. I did just change it to .html and it's working fine, but was wondering what the difference is - anyone care to clue in an old lady??? :)<!--content-->There is no significant difference between .htm and .html. as far as I know. Was it your index.html file that you tried to replace and didn't work? Your host has probably got it set so that you have to use the .html extension for that file so it couldn't find the file it was looking for. You can quite easily rename the file to .html and it shouldn't affect it. If it was another file on your site that you tried to upload, make sure that your link to that page is using the correct extension.<br />
<br />
Generally it is good practice to choose to use one extension and stick to it throughout your site. As for Microsoft Word's 'Save As HTML', it's a very quick and dirty way of creating web pages and any self-respecting web designer wouldn't touch it with a barge pole! It tends to put in a lot of unnecessary code making the file size a lot bigger than it needs to be. But that's just my opinion!<br />
<br />
Hope this helps. ;)<!--content-->All Windows OS above Windows 95 support long filenames. So does Unix and its varients. Windows 3.x and DOS, however, doesn't. They support a maximum of 3 letters in an extension. So .html becomes .htm<!--content-->but now-a-days the .htm extension is hardly ever used. as almost all OS's support long file extensions. thre is no real big difference in the page if it was .htm or .html just depenmds on how the server is set up.<!--content-->I got into the habit of using htm when I was making stuff on a unix/ linux box. It seemed appropriate at the time since I use lots of three letter extentions.... jpg gif swf mpg avi jsp asp cfm doc pdf and so forth. I havent had a problem using the htm extention on any of my servers so far, but I also write them in html editors (coldfusion/ homesite/ kawa) and these editors support me saving in the htm extention. The servers I use all recognize the htm extention, and if not its easy to test and change.<!--content-->Short Answer<br />
------------<br />
Other then the obvious, the letter "L," there's not much of a difference between the two extensions. Most, if not all, web browsers and servers will treat a file with an HTM extension exactly as it would a file with an HTML extension, and vice versa. <br />
<br />
Long Answer<br />
-----------<br />
Practical Differences<br />
<br />
Practically speaking, there is no difference between the two extensions. Both denote that the file contains HTML. This is really a matter of convention and is not an absolute, but most realize that a file whose extension is htm or html contains HTML. <br />
<br />
On most, if not all, servers either file will be sent with a MIME type of text/html by default. This can usually be changed by the server's administrator(s), but is, more often then not, left alone. <br />
<br />
On most, if not all, browsers, either file will be displayed as intended (i.e. rendered according to the browser's default manner of displaying HTML documents). This last is due more to the MIME type sent by the server then by the file's extension, but that's a matter for another FAQ. <br />
<br />
Generally, the use of htm over html, or vice versa, is left to the author's personal preferences. <br />
<br />
Technical Differences<br />
<br />
Technically speaking there are few to no important differences. An obvious difference is the addition of the letter "L" in the html extension. The technical difference that the additional letter will make to the operating system is better left to a different discussion but in the context of a web author, the additional "L" will make no difference. <br />
<br />
The technical difference that the additional letter will make to an http server (a "web server") is minimal. Usually, a server will use a file's extension to figure out what MIME type to send back to the requesting client. Most servers are configured by default to send back the text/html type when the requested file ends in an htm or html extension. This can be changed by the server's administrator(s) in such a way that one of the above extensions returns a different MIME type then the other, however, this is not a very common practice. <br />
<br />
It is a common misconception that a file ending in an htm extension had to have been created on a DOS/Windows 3.x platform. This is because those operating environments limit filenames to a 3 letter extension. However, it is very simple to create a file with a 3 letter extension on most other platforms, as well. Even those that allow longer file extensions. <br />
<br />
Default Filenames<br />
-----------------<br />
The one situation in which there may be a difference between the two extensions is that of a server's default filenames. When a URL that does not specify a filename is requested from a server, such as <!-- m --><a class="postlink" href="http://www.domain.dom/dirname/">http://www.domain.dom/dirname/</a><!-- m -->, the server returns a file from the requested URL that matches a default filename. Examples of common default filenames include "index.html," "index.htm," "welcome.html," "welcome.htm," "default.html," "default.htm," etc. However, an administrator can make the server's default filename anything he/she so desires. <br />
<br />
In the case of a default file, the author's filename must be exactly the same as the server's default filename. In other words, if your server is configured to use "index.html" as the default filename, your file must be named "index.html" and not "index.htm." <br />
<br />
Note that servers are often configured with more then one default filename. Check with your server administrator or ISP for details about your specific server.<!--content-->Wow..lots of info - does anyone know why Word does this? I even tried the option of "choose HTML only" and it still came out in .htm and I guess my server just doesn't like it because it would not accept those .htm pages. I did check the links and such, yes. You see, I had a survey up asking what people would like to see more of and was swamped with the answer "recipes". So, I thought every week my newsletter subscribers could have access to new, free recipes. I didn't want to have to sit here and hand code pages every week and then while reading about something entirely different I learned you can make some quick pages with Word, so I fooled with it. I'm not making anything fancy by a long shot on them. It's just text and of course, maybe I'll toss in an ad or two..:D<br />
<br />
"As for Microsoft Word's 'Save As HTML', it's a very quick and dirty way of creating web pages and any self-respecting web designer wouldn't touch it with a barge pole! It tends to put in a lot of unnecessary code making the file size a lot bigger than it needs to be. But that's just my opinion!"<br />
<br />
Hehe..sincerely had to chuckle a little here because I did learn that - FAST! At first I thought it was great - such a time saver. Then, I went in to make changes and good lord - the code was unbelievable! I probably spent more time cleaning it up than I would have just making the pages from scratch in notepad! Maybe it's time I learned either how to use templates or maybe an editor. I Download <!--more-->ed one of them that was suggested in the forums here, but haven't tried it yet. Been so darned busy.<br />
<br />
Thanks for all the input, everyone!<!--content-->Hi, Jeni :)<br />
<br />
that is why I don't use word for webpages :)<br />
<br />
the reason it saves in .htm is because that is the default extension for webpages in word. just add an L at the end.<br />
<br />
or if you save it and type the name also type the html extension and see if that does it.<br />
<br />
if you want a fast template just make a html page and then save it as template.html and when you open it up, just insert the text you want and save it as the page you want, leaving the template intact for future use.<br />
<br />
so it would look like this<br />
<br />
<html><br />
<head><br />
<title> </title><br />
</head><br />
<body><br />
<br />
put your text here<br />
<br />
</body><br />
</html><br />
<br />
so the only thing you change is "put text here" and save it. very easy. ;)<br />
<br />
if you knnow something that will always be in there, just add it and don't change it next time.<!--content-->
 
Back
Top