I've always wondered about this... is it better to make an HTML file .htm or .html?
| SitePoint Sponsor |
I've always wondered about this... is it better to make an HTML file .htm or .html?
Quote(s) of the [insert random period of time here]:
“War does not determine who is right,
it only determines who is left.”
________-Unknown[Last updated April 12, 2006]


AFAIK the "htm" extension is from the time when filenames were limited to only 8 characters (joliet name) and file extensions were limited to only 3 characters. Things have changed a lot since then and there should be no problem with using "html" for current machines.

html because its easier and simpler
Failure: Failure is the dress rehearsal for success.
Statistics: The only science that enables different
experts using the same figures to draw different conclusions.
I'd go with .html as it makes more sense. I can't confirm it, but I think search engines prefer .html (though maybe only over .scriptinglanguage)

That's a common myth. Search engines give no prefernce to any file extension.Originally Posted by SRTech
![]()
John Conde | Facebook | Twitter
Brainyminds Merchant Account Services I Love Code eBook Giant
Authorize.Net: AIM API | ARB API | CIM API Get the FREE code!
Merchant Accounts 101 | Ecommerce 101
Yea, you can use any file extension, and search engines will index you the same. The content is what matters. I actually use .shtml, when i am not using .php, I'm not sure why, but it works just as well.
HTMLGuy
I think both are the sameOriginally Posted by Zarel
.htm or .html don't let you use server side includes. .shtml doOriginally Posted by htmlguy
To be honest though I'd probably just use a .php extension then as well though as if you later decide you need some php functionality in the page then you can quite easily slot it in without needing to worry about changing extensions and then changing all the links which link to that page.
If you know it's going to be a static site then personally I'd just use .html but most of the time I know that I'll at least be using some .php functionality to drive navigation so most of my sites now use the .php extension.
But you're incurring PHP processing overhead on static content which is kinda wasteful.Originally Posted by csswiz


that's true only if the server actually has php installed and listeningOriginally Posted by vgarcia
Also, naming it .php makes me unable to view them in my browser without uploading it to my server first. Plus, when I make something .html, it's usually to send to someone else, someone who might not have a server and/or PHP installed, so I can't just make it .php.
Quote(s) of the [insert random period of time here]:
“War does not determine who is right,
it only determines who is left.”
________-Unknown[Last updated April 12, 2006]
You can if you install a WAMP package like XAMPP or Uniform Server.Originally Posted by Zarel

I usually just go ahead and use .php, but sometimes I'm on a comp without any server installed to it, and then that's just a pain. I just go ahead and use .html when that happens, since html is what the page is written in![]()


It doesn't matter what extension you use.
For instance, I can serve my jsp pages with a .dll, .php, .asp, .html or .whateverIwant extension. It's up to the server to send the appropiate mime type. The client doesn't (and shouldn't) care about the file extension!
If you run html-files on the local computer instead of through a web server, then of course it's different.
It' doesn't really matter what extension you put.
I'm starting to really like the idea of no extension at all. It makes for a better looking URL ex. http://mysite.com/contact
Hmm I dont think that is true. My site utilizes SSI and all pages are *.htmOriginally Posted by csswiz
My include file is *.shtml
Bookmarks