I often see urls such as website.com/blog/post. How are these urls valid since it appears they point to a webpage named post that does not have a .htm suffix? To be a valid url it seems the address should be website.com/blog/post.htm.
A URL of [www] domain.tld does not have an extension on the name either but is still valid.
A web server has a sequence of tests to 'decide' on what content should be served to the user agent for a requested URL.
If the URI, (URI because it is no longer a URL at this point) ends with a slash "/" the server 'knows' that it is a directory that is being requested, so it tries to find a document name that is in the "Index Document" list (index.html index.htm default.htm and so on) and it delivers the content from the first one it locates.
If the URI does not end in a "/" but has no document name appended, the server will append a slash and make an "internal" redirect to the new URI.
If the requested URL ends in a document name, the server will locate that then process it according to the MIME type and serve the resulting content to the requesting agent.
Chris.
Indifference will be the downfall of mankind, but who cares? Time flies like an arrow, however, fruit flies like a banana. Webmaster Forum
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.