.htm or .html extension - which one is correct and what is different?

前端 未结 10 712
广开言路
广开言路 2021-02-01 12:28

When I save a file with an .htm or .html extension, which one is correct and what is different?

10条回答
  •  一个人的身影
    2021-02-01 13:07

    Also notice that as part of a URI, the file extension doesn't play any role. In fact, it isn't even a file extension, it just looks like one. The type of the resource identified by a URI is not encoded in its name. Instead, it is decided by the Content-Type HTTP header field. It's completely legitimate (but perhaps a bit stupid) to deliver a bitmap picture as myimage.html and conversely, to deliver an HTML page as index.png. This is also the reason why it is argued that file extensions shouldn't be part of URIs at all.

    Sir Tim Berners-Lee elaborates on this in Hypertext Style: Cool URIs Don't Change.

提交回复
热议问题