extensions

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

When doing plain html pages (as opposed to php, asp etc) do you use the extension .html or .htm?

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

I use .html

Shouldn't matter which you use, unless your server settings for index pages or scripts and the like point differently.

I believe .htm was used in the days when file extensions could be only 3 chars long (DOS).

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

That's what I thought but my hosting company say that .html is the 'old' way??!!

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Quote: Originally posted by The Webmistress
That's what I thought but my hosting company say that .html is the 'old' way??!!

They're idiots if they say that because the reverse is true. Unless you have visitors running Windows 3.1, you won't have any problems with the .html extension.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

He has: 1,016 posts

Joined: May 2002

Quote: Originally posted by The Webmistress
That's what I thought but my hosting company say that .html is the 'old' way??!!

LOL! I think they've got it backwards or are idiots as mairving said. The ".htm" extension is the old way since back in those days MS-DOS could only handle max 8 char filenames and max 3 char extensions.

".html" is the way to go.

Jimmy Changa's picture

They have: 220 posts

Joined: Mar 2003

Six one way, half a dozen the other Wink

I use .html mostly. Smiling

He has: 1,380 posts

Joined: Feb 2002

".htm" used to be a standard used when you are running a page editor on a Mac computer...

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

I used to use .htm untill a last year for some reason...

taff's picture

They have: 956 posts

Joined: Jun 2001

I'm an .html user myself. I do notice though that most html-generating programs use .htm by default. I've always found this a handy, if not entirely accurate, way of telling whether a page has been hand-coded or not.

.....

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Quote: Originally posted by taff
I'm an .html user myself. I do notice though that most html-generating programs use .htm by default. I've always found this a handy, if not entirely accurate, way of telling whether a page has been hand-coded or not.

No way. I can usually tell because they have a .php extension.

Okay another question.

Do you save your .php pages as .htm or .html?

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

No... heh, I save them as .php unless I'm forced to deal with wacky people, then it's .phtml -- though I would consider it if my whole site was parsed and required .shtml or .php extentions, but why would that be a good thing?

Jimmy Changa's picture

They have: 220 posts

Joined: Mar 2003

I thought that if the page included any PHP code, the extension had to be .php

*shrugs*

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Quote: Originally posted by TortillaBoy
I thought that if the page included any PHP code, the extension had to be .php

*shrugs*

No, you can tell it either in the Apache httpd.conf file or an .htaccess file to parse a file with any extension that you want.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Jimmy Changa's picture

They have: 220 posts

Joined: Mar 2003

Do you know where I can read about how to do this?

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

If you are on a 'nix based server, open up your .htaccess file. Here is some info on .htaccess. To get it to parse .htm files as php add this code:
AddType application/x-httpd-php .php .htm .html

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Jimmy Changa's picture

They have: 220 posts

Joined: Mar 2003

that just might help me out quite a bit...thanks.

Busy's picture

He has: 6,151 posts

Joined: May 2001

I use .html, .phtml and .php with PHP Laughing out loud

problem using .html for PHP pages is people contact you asking how you did it (especialy if it has a form), like my 404 page and if you notice the contact page on that same site is .phtml lol - confuse them Laughing out loud

DaveyBoy's picture

They have: 453 posts

Joined: Feb 2003

Windows 2000 servers don't allow the .html extension.

Busy's picture

He has: 6,151 posts

Joined: May 2001

windows servers are so last month, upgrade to apache or similar Laughing out loud

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I can't believe Windows servers don't allow the .html extension, they allow other four character extensions (.aspx? .phps?)

http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/iis/deploy/rollout/lapa2iis.asp

Well, that's not the case for IIS, anyway.

Oh, here:

Quote: File Name Extensions

UNIX files support file name extensions of any length. Traditionally, Windows supported file name extensions that were up to three letters only. This limitation is no longer enforced, and you can use any number of letters in file name extensions. For example, Windows uses the same basic extension as Apache for server-parsed files (.shtml files). However, Microsoft recommends that you match file name extensions between the two platforms. Windows places a greater significance on the file name extension, using it both to identify the file type and to determine whether the file is run in Internet Information Services (IIS).

from: http://support.microsoft.com/default.aspx?scid=kb;en-us;324054

emphasis is mine.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.