Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URL Names

Status
Not open for further replies.

bgreen39

Technical User
Oct 29, 2009
59
0
0
US
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.

Thanks, Bob
 
How are these urls valid since it appears they point to a webpage

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top