Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File extension .htm or .html?

Status
Not open for further replies.

tabbytab

Technical User
Mar 21, 2005
74
GB
File name extention for HTML pages.
Are there any consequences of using .htm v .html?
Are they totally interchangeable?

Which is the best one to use

The reason I ask is I've just had a web site sipdered but it only found the .html pages.

Thanks in advance
TabbyTab :)

 
I have never thought that there was a problem using .htm over .html and have always considered them interchangeable -- although I've always used .html myself.

I guess if you were using an old IIS setup you might be forced to use .htm instead of .html. Modern Windows operating systems can handle .html now.

The only reason I can think that you might chose .htm over .html would be to save bandwidth (1 character of the file name per page request)! [smile]

I have no idea about the spider you speak of. It's probably some poorly configured tool that someone is using to create an index. I wouldn't bother about it.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Are there any consequences of using .htm v .html?
Are they totally interchangeable?
No and yes, respectively.

.htm is/was more common on PCs, a hangover from the days when file extensions had to be three letters long. Now you can name your files how you like, but old habits die hard.

The only HTML file extension that is usually significant is [tt].shtml[/tt], which servers will generally parse for Server Side Include commands before sending them out.

Ultimately, the type of a file (from the browser's point of view) is not determined by it's extension but by the MIME headers sent with it. These are determined by the way the web server is configured (the server usually DOES look at extension to decide what header to send). You could set a server up to serve any header with any file type, but, out of the box, they'll send [tt].htm[/tt], [tt].html[/tt] and [tt].shtml[/tt] files with a text/html header.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
There is no problem with interchanging .htm and .html. They should both render the same in any browser, whether the file extension is changed or not (though this isn't the case for XHTML files in browsers that use the .xhtml or one of the many other extensions to recognize the media-type application/xhtml+xml when viewed locally). :p
 
Ultimately, the type of a file (from the browser's point of view) is not determined by it's extension but by the MIME headers sent with it.

Except for IE, which also (very unhelpfully, in my opinion) determines the file type by parsing the content, thus rendering the "Text/Plain" Content-Type header field useless [curse].

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top