CrazyEngineers
  • htm vs html

    ce_neha

    Member

    Updated: Oct 27, 2024
    Views: 1.1K
    hello everyone!

    What is the technical difference between htm and html extensions?
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • sookie

    MemberAug 21, 2009

    Hi ce_neha,

    As far as web is concerned there is no difference except an extra 'L' but basically this .htm and .html matters when there is a mismatch in the filename specified in the url and as processed by server.

    Example :Consider following url which says I want .html file from the server
    #-Link-Snipped-#
    Now as you and me know .htm and .html are both same so I can use .htm also at the end right?So now try this url -same as above just changing .html at the end with .htm
    #-Link-Snipped-#
    But as server's default filename processing is such that it so not consider .htm and .html files same so it don't give desired page when I click on second modified url.

    We can change such things in server configurations I guess such that it accepts .htm and .html file as same.

    Am I sounding like an alien? Please correct me if anything wrong.

    Thanks !
    Are you sure? This action cannot be undone.
    Cancel
  • safwan

    MemberAug 22, 2009

    As far as I know is when we make HTML file we save it as .htm and as said in above post no technical difference.

    <a href="https://en.wikipedia.org/wiki/HTML" target="_blank" rel="nofollow noopener noreferrer">Html</a>
    Are you sure? This action cannot be undone.
    Cancel
  • ce_neha

    MemberAug 22, 2009

    Thanks sookie,
    But i don't understand why browsers refer them as 2 different files?
    Why two extensions are provided for saving a document?
    Are you sure? This action cannot be undone.
    Cancel
  • sookie

    MemberAug 23, 2009

    ce_neha
    Thanks sookie,
    But i don't understand why browsers refer them as 2 different files?
    Why two extensions are provided for saving a document?
    Hi ce_neha,

    I guess there is nothing to do with browser with this .htm and .html files. They just show what servers send them.so things depend on your server configuration as i mentioned earlier and regarding using two extensions for saving a file containing same code I think your query is answered well here #-Link-Snipped-#. I guess following explains what you are looking for

    When the Web started, it ran almost exclusively on <a href="https://computer.howstuffworks.com/question246.htm" target="_blank" rel="nofollow noopener noreferrer">What is Linux and why is it so popular? | HowStuffWorks</a> machines and all pages were static. Html was the standard file extension. When people started using <a href="https://computer.howstuffworks.com/pc.htm" target="_blank" rel="nofollow noopener noreferrer">How PCs Work | HowStuffWorks</a> running DOS or Windows as <a href="https://computer.howstuffworks.com/web-server.htm" target="_blank" rel="nofollow noopener noreferrer">How Web Servers Work | HowStuffWorks</a>, however, the four letters in "html" were problematic. PCs followed an 8.3 naming convention that allowed only three letters in the extension. So the world made room for two standard extensions: html and htm. It used to be that you could tell whether a Web site was running on UNIX or Windows by looking at the file extension, but now there is no distinction. HowStuffWorks runs off a UNIX server but uses "htm" as its extension -- it's the webmaster's choice.
    Addendum: Chek following two links -one ending with .html amd other ending with .htm
    #-Link-Snipped-#
    and
    #-Link-Snipped-#
    Both the above links give same output unlike the behavior of the links I mentioned in my pevious post.

    One more thing I would like to add from my side. - See if you have same piece of HTML code and you are saving it in two different files one with .htm extension and one with .html extension and when you try to open those pages in your local machine, it is obvious both will give same output but if they are loaded at any server and if the server's configuration is such that it interprets both the files differently then the scenario I explained in my previous post would happen.

    Hope your doubt is cleared now? Feel free to ask if any questions. 😀

    Thanks !
    Are you sure? This action cannot be undone.
    Cancel
  • Munguti

    MemberAug 23, 2009

    Okay so they are the same. i understand that.
    My question is why then do we have both of them? why not use one extension and stick to it?
    Are you sure? This action cannot be undone.
    Cancel
  • sookie

    MemberAug 23, 2009

    Munguti
    Okay so they are the same. i understand that.
    My question is why then do we have both of them? why not use one extension and stick to it?
    hi Munguti,

    Have you looked at the link I gave in my #-Link-Snipped-#post and thing I explained there? And regarding sticking to one extension , I guess for it some standardizations would be needed.

    Thanks !
    Are you sure? This action cannot be undone.
    Cancel
  • ce_neha

    MemberAug 24, 2009

    Thank you Sookie,

    Now I don't have any doubt about it.

    Thanks!
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register