Forum Moderators: phranque

Message Too Old, No Replies

.htm .html .shtm .shtml

Any reason to mix and match?

         

Visit Thailand

3:50 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Personally I like clean websites but I have noticed some sites that use a mixture of .htm and .html

Is there any reason for a site to do this?

In my mind each page should have the same extension especially if it is only .htm or .html

dougmcc1

4:00 am on Feb 25, 2004 (gmt 0)

10+ Year Member



Maybe to promote duplicate content?

I don't know if this has anything to do with the sites you noticed it on but 2 pages with 2 different file extensions could be named exactly the same and have nearly duplicate count but they would be regarded as 2 entirely different pages by SE's.

Visit Thailand

4:02 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No the pages are completely different.

Would you agree that it is better site design that all pages should be either .htm or .html (if using that style) rather than mixes of the two?

dougmcc1

4:28 am on Feb 25, 2004 (gmt 0)

10+ Year Member



Definately. I think it's common sense. That's why it makes me suspicious.

tombola

11:02 am on Feb 25, 2004 (gmt 0)

10+ Year Member



IMO, the best thing you can do to prevent mixing filename extensions, is to use content negotiation (Apache).
This way, you can omit filename extensions, so if you later want to switch from .html to .php, you must do nothing. You get also a much cleaner url without filename extensions.

grandpa

11:55 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't know if I'd want to omit the extentions. I am switching some pages to php and using rewrite to retain the original extension. That leaves the SEO'd document in place.

As far as using htm or html. I wouldn't mix them, even as my site still has a few old htm's around. I just 301'ed the last of them. Call me crazy but I would like to develop a root level site and will probably use the htm extension to identify the documents on that site. It would be related to, but unique from the www content.

tombola

12:51 pm on Feb 25, 2004 (gmt 0)

10+ Year Member



grandpa, with content negotiation the original document doesn't change. The document resides on the server WITH its filename extension (.html, .htm, .php), but you can access it with or without that extension.

jetboy_70

1:07 pm on Feb 25, 2004 (gmt 0)

10+ Year Member



There could be a perfectly innocent explanation:

. They could have PHP parsing enabled on .html files but not .htm.

. The site could have been built over time by different developers.

. They could have just upgraded their design software. Doesn't Dreamweaver produce .html files by default now? It used to be .htm.

All of these reasons do suggest a lack of care and attention though.

I assume you already know that .shtml and .shtm files are set aside for server-side includes by Apache, so there are valid reasons for using at least one of these extensions.

choster

3:21 pm on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On one of our sites, .html is the default, generated by a content management system. Any directory or .html requests are intercepted by the CMS and processed. To allow the webserver to serve a static file outside the CMS (namely, three framesets... long story) we use .htm .

Otherwise, no reason.

ergophobe

4:34 pm on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My guess is that this is usually the accretion of old pages and new pages and due to a lack of an in-house standard, rather than part of some brilliant overall plan.

Also, I have to agree with the person who mentioned content negotiation. It seems that few folks realize that the W3C recommends that your URIs have no file extensions in them ever. Reasons for this

- URI doesn't change when technology changes. When all your pages are upgraded to VRML (Virtual Reality Markup Language) or XHTML 3 [cs.tut.fi], you don't have to change you links.

- easier for human readers

- tiny, tiny security boost (you hide the underlying technology and possibly file structure from the casual hacker).

Tom