For a long time, I have been using
as an image, but I just checked that http://www.w3.org/Icons doesn’t actually have that file or folder, but several images with the name valid-html401.___ such as gif or png.
So it is surprising: seems like for a long time (even if IE 6), we can specify an image <img src="http://www.w3.org/Icons/valid-html401"> without the file extension of the image file? What’s the rule?
The rule is: URLs are not filenames.
The data type is determined by the Content-Type HTTP response header, not the format of the URL.
Web servers can decide what content to serve up (and what Content-Type header to send) for a given URL however they like.
Map URIs directly onto the filesystem and determine the content type from the extension is just a simple and common approach.
Other options include Apache Multiviews and using a programming language (usually with a framework such as Dancer) to decide using whatever custom logic you like.