views:

75

answers:

3

Possible Duplicate:
What’s the point in having “www” in a URL?

Hello, I have little to no experience owning a website but I am willing to learn all that there is to this process. However I am frustrated because I am constantly blocked by simple problems.

I just uploaded my first index.html page which is basically a background color and a title image. I put my favicon in the public_html directory right next to index.html. I immediately notice that it does not work. I also notice that I have typed http://website.com in the URL bar. I type "www" before "website" and the favicon shows up. I hit back and the favicon is blank again. What is the difference between the non-www version of the site and the www version of the site? Why does the favicon not show up? What other differences are there? Should I disable the non-www site like many professional sites seem to do? How do I do this? What are the advantages and disadvantages, if any?

Thank you.

+2  A: 

The fully qualified domain names are different. So they are different websites.

Usually the two hostnames will point at the same IP address, and the server will be confiured to either serve up the same content for both or redirect from one to the other.

Redirecting from on to the other (and which way round you do it doesn't really matter) is generally considered good practice as it lets you be consistent (and saves you from issues such as XHR requests to a specific hostname breaking when used on the alternative).

The favicon not working is likely caused by your browser having cached that http://www.example.com/favicon.ico didn't exist and it not having yet checked again. http://example.com/favicon.ico, OTOH, is a different URI so it would have checked it the first time you went there (which was after you created the icon file).

David Dorward
+3  A: 

The www-subdomain is just a convention amongst websites to indicate this address points to a World Wide Web server.

For example,

  • google.com is the top domainname of the Google company.
  • www.google.com indicates this is the domain name for the World Wide Web,
  • ftp.google.com indicates this is probably an ftp-server.

But as it is just a convention, and the average user uses the internet mainly for www, most servers configure their http://domain.com to be aliases to http://www.domain.com.

Why the favicon on your site only shows up for the www-version and not for the topdomain, depends on your html and your server configuration. Can you post some code or link to your site?

Konerak
To access FTP, you could just type , `ftp://google.com`, couldn't you?
Pavel Shved
@Pavel Shved — only if there was an ftp server running on the machine that google.com pointed to.
David Dorward
@David, this means that the reasons of having different domains have no relation to users, it's due to insufficiency of administration tools.
Pavel Shved
It's the other way around: www.domain.com is a subdomain of domain.com, which is often set as an alias of domain.com but doesn't have to be.
Jeanne Pindar
@Pavel — until you want to run two ftp servers, on different machines, but both come under the same domain.
David Dorward
A: 

Typically most of the server domain manager software like Cpanel and Plex are configured to serve same site for both domains. Cpanel do have a public_html and www separately, but same content.

Ankit Jain