Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
  • Why is that some URL's end with .html while some do not, while most of them are HTML pages?

  • Why is that some URL's begin with www and some do not, while all of them are on World Wide Web?

share|improve this question
    
not all URLs are on the world wide web. ftp://example.com doesn't point at an HTTP server, even if http://example.com does. –  quack quixote Mar 16 '10 at 16:21
add comment

2 Answers

up vote 4 down vote accepted

Because frequently nowadays, the HTML pages are dynamically generated.

Most of the time, the extension describes the producer of the HTML page. For instance, .asp means the page has been generated by ASP code (programming code embedded in a page). Same for .jsp, Java Server Pages, which are on the server pages containing a mix of HTML and Java code. There are plenty of other extensions that use the same mechanism (.do, .aspx, .cf, ...)

In the end, all the browser receives is HTML, but all the compilation and the logic has been run on the servers.

For the www.mydomain.com, it actually means you contact a server (or router) called "www" in the domain mydomain.com. While it's a convention, you're not forced to follow it. Domains (in the DNS entries) can be configured to say "if no explicit servername is specified, send requests to the web browser).

You can also give any other name to the Web server and have it known externally, like http://mywebserver.mydomain.com.

Note the external name (www, mywebserver) does not, most of the time, relates to the physical name of the web server. Actually, on big sites, several servers are processing requests coming to a single name.

share|improve this answer
    
What is the webserver name for http://stackoverflow.com? –  Lazer Jul 22 '10 at 14:10
add comment

an url consists of several parts:

  • a protocol part
  • a server part
  • a file/resource part

    protocol://server/file_or_resource

the protocol part is the http:// or ftp:// or ssh:// or whatever you can think of. the server part is everything between the protocol part and the file/resource part

http://google.com/index.html

in this case its "google.com", in other cases its "user@machine:port". so, this is the answer to your 2nd question: some machines are called "www.hostname.com" and some other are called "hostname.com".

as soon as your browser / protocol handler connects to the server described in the server part through a protocol described via the protocol part of the url, it asks the server for the resource given in the resource part. and thats the answer to your first question: you ask the server for a file/resource and the server answers.

http://google.com/index.html <- you ask it for "index.html"

if the server has it, fine. if the name is "foo.bar" and the file exists, fine. if the server knows what to do when you ask it for "more.money" .. cool.

read more about it 'at wikipedia'.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.