Forum Moderators: open
Is it better and more compatible with everyhting to have html or htm as the extension on web page files please?
I'm just about to start a web site, that will, when it's finished, have about 400 pages, so I would like to get it straight from the start.
It probably works ok both ways, but is one better than the other?
It was developers running FrontPage and the ilk running on old Windows boxes that could only handle 8.3 filenames that caused *.htm to be born.
But either will work perfectly well (even on old Windows boxes) in fact you could call your page "mypage.dougiesownextension" and it would still work perfectly well (in theory).
Although functionality is in no way altered by using one or the other, it simply follows traditional rules.
I was taught in 1996 to use HTML for "index" pages (as it was the standard) and HTM for all subsequent pages. I have followed that rule ever since. I have noticed most older webmasters doing the same.
Thats interesesting, goes against my thinking :). I think the most important thing is too choose one and stick with it. Otherwise you could end up having 2 pages that are the same, you forget(as all webmasters do ;)) there are 2 pages and you end up only updating one. Later you discover there is page.htm that people are visiting only you havent updated it in the last year ;)
HTM suffix came about due to the fact that old computers could only display a 3 letter file suffix.
I use htm cause I'm a DOS child (my 386 and 286 are still running well).
Someone said it looks unproffesional to him... Well... In that case I'll probably never stop using htm ;) .
http: //domain.com/archive/2004/jan/16/ There is no filename or extension at all. The thinking behind this is that regardless of any future or existing web technology the URL will remain the same. Thus whether you're using ASP, PHP, HTML, SHTML or something else you can control this behind the scenes and never have to change your URL at all. I think they may be on to something here.
the example you posted would just point to a page named index.html wouldn't it?
There are two reasons for this:
1 - naming the default directory file as "index.html" is just a convention. When the browser asks for a directory (rather than a file) the webserver sends back the default directory file. This is commonly index.htm(l), but could be default.asp, index.php, fish-and-chips.jsp, or anything-you-like-at.all
2 - to complicate matters even further, the URL may not even correspond to the actual directory structure. Tools like mod_rewrite and ISAPI_Rewrite allow the entire website and its complicated directory structure to be served from only one dynamic page (if that's what you wanted)
example:
your server is set to display yoyo.html as default;
yourdomain.com
/folder
yoyo.html
page2.html
type in yourdomain.com/folder, your browser displays yoyo.html
your address bar displays yourdomain.com/folder
type in yourdomain.com/folder/page2.html, your browser displays page2.html
your address bar displays yourdomain.com/folder/page2.html
I think this is correct,
robert
[w3.org...]
Scroll down to the section entitled "What to leave out" (and read the footnote, too) to understand what the bloggers are trying to do. (Then remember, getting technical advice from bloggers is like a playing a game of "post office" -- what you hear is seldom the original message.)
The right thing to use is html because that's what it is supposed to be.
(It's a html protocol we're using btw, not htm.)
The same for the www prefix. I wish everybody would stop using it as it is totally superfluous.
(Although it makes an url more recognizible as just that.)
cruft-free URLsThere are a few ways people are using this...one way is to generate a pseudo folder so that the default page will show. Another way I've seen people do this is to modify their .htaccess files to allow the display of file names without any extension at all. So, you could have files named whatever you wanted.
The purpose of this again is to future-proof your URLs by removing unnecessary information in the address string.