views:

1046

answers:

8
+9  Q: 

.htm vs .html

Which extension should I choose for my HTML files and why?

+5  A: 

same thing.. makes no difference at all... htm was used in the days where only 3 letter extensions were common.

waqasahmed
+2  A: 

If you plan on putting the files on a machine supporting only 8.3 naming convention, you should limit the extension to 3 characters.

Otherwise, better choose the more descriptive .html version.

xtofl
Then should we be appending 'l' for language to all source files? ;)
frou
+4  A: 

.html - DOS has been dead for a long time. But it doesn't really make much difference in the end.

Pavel Minaev
+18  A: 

The short answer

There is none. They are exactly the same.

The long answer

Both .htm and .html are exactly the same and will work in the same way. The choice is down to personal preference, providing you’re consistent with your file naming you won’t have a problem with either.

Depending on the configuration of the web server, one of the file types will take precedence over the other. This should not be an issue since it’s unlikely that you’ll have both index.htm and index.html sitting in the same folder.

We always use the shorter .htm for our file names since file extensions are typically 3 characters long.

AND MORE ON :http://www.sightspecific.com/~mosh/WWW_FAQ/ext.html

joe
+3  A: 

.html always for new files. .htm is a throwback to dos days.

DanDan
A: 

Since nowadays, computers support widely any length as file type, the choice is now only personal. Back in the early days of Windows where only 3 letters where supported, you had to use .htm, but not anymore.

xav0989
you mean, "back in the early days of *Windows* where only 3 letters (in extensions) were supported". Unix and Mac OS (even pre-OS X) never had those limitations; we were using `.html` extensions from the very start.
Val
+12  A: 

Neither!

If you're asking; "what would a website visitor rather type, htm or html" - it's much better to give them a nice descriptive URL with no extension. If they get used to going to yoursite/contact.html and you change it to yoursite/contact.php you've broken that link. If you use yoursite/contact/ then there's no problem when you switch technology.

Sohnee
+1. I always feel like I've traveled back in time when I see resources ending in `.html` on a modern website.
Grant Wagner
That's quite a good idea. Still, isn't there a distinction between the storage and the url? Shouldn't that be the server's job?
xtofl
It's up to you how you achive yoursite/contact/ - I use mod_rewrite on Apache or URL routing on Windows. Some people use folder structures, which isn't ideal - but can still easily be replaced with either mod_rewrite or URL routing later.
Sohnee
Yes you should rewrite the url, but you still have to have something behind it. Anyway, +1.
jeffamaphone
A: 

It's the same in terms of functionality and support. (most OS recognize both, most Search Engines recognize both)

For my everyday use, I choose .htm because it's shorter to type by 25%.

Wadih M.
So you're willing to not include a DOCTYPE?
Hello71
@Hello71: i don't get it
Wadih M.