When I save a file with an .htm or .html extension, which one is correct and what is different?
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.