1

I have a simple question which may be naive, but am still gonna ask it anyways-

When I try opening a website with this URL : www.oyc.yale.edu It doesn't open, however if I open it by removing www from the URL oyc.yale.edu, it opens up.

Isn't www supposed to prefixed before every URL ? Also, what about http ? Can some one care to explain ?

Adriano Repetti
  • 65,416
  • 20
  • 137
  • 208
OneMoreError
  • 7,518
  • 20
  • 73
  • 112

3 Answers3

3

the www you see on many URLs is in-fact an optional subdomain. Subdomains (separated.by.dots) may point to a different address than their parent domain, or they may not be defined by the admin. If an admin doesn't define the subdomain www to be anything then www.oyc.yale.edu is the same as somerandomwords.oyc.yale.edu. Further, www doesn't have to point to the same server as the parent domain, so www.oyc.yale.edu doesn't have to deliver the same content as oyc.yale.edu, in the same way that oyc.yale.edu doesn't deliver the same content as yale.edu or www.yale.edu. That they do is simply a courtesy and tradition.

As for HTTP, that's optional in a browser these days. HTTP stands for HyperText Transfer Protocol. A Protocol is a defined way that computers talk to each other. There are actually a number of protocols on the internet, and the HTTP just tells your browser which one the server uses. Another common protocol on the internet is FTP, File Transfer Protocol. Your browser can understand both. Try going to ftp://ftp.microsoft.com to try it out.

Patrick Gunderson
  • 3,263
  • 17
  • 28
  • I'm kinda getting your point. Btw can you also tell me how can we define sub domains in websites ? – OneMoreError May 31 '14 at 07:12
  • Are the sub domains based on the directory name on which we keep our files ? – OneMoreError May 31 '14 at 07:12
  • Defining a subdomain requires two servers: first the name server. This is an index that lists what the subdomains are, and to what server they point. second, a particular server has to be configured to answer to a request from a particular subdomain. Individual servers can host multiple subdomains. Subdomain names are unrelated to the directory on a server (they can be configured so the directory name matches the subdomain, but don't have to) – Patrick Gunderson May 31 '14 at 07:14
  • Thanks Patrick :) If you know of any example where sub domains are configured that I can learn from, please let me know. Cheers !! – OneMoreError May 31 '14 at 07:29
  • No problem! Apache is a popular web server and they have some good reading about how to setup a subdomain on a web server: http://httpd.apache.org/docs/current/vhosts/examples.html and google has a good writeup about adding a cname on your name server for your subdomain to point to your apache server https://support.google.com/a/answer/47283?hl=en – Patrick Gunderson May 31 '14 at 07:32
1

The general form of a HTTP URL is

http://<host>:<port>/<path>?<query>#<fragment>

Not all the components need to be present.

In your example the URL would be http://oyc.yale.edu, which just has a <host> part. The http is mandatory, but most modern browsers add it automatically if not provided by the user. The <host> is the DNS name of the site, there is often a www prefix in the name but this is only a convention and a site may choose a name without it.

Many other forms of URIs exist, refer to RFC 3986 for the full details.

Community
  • 1
  • 1
Henry
  • 42,982
  • 7
  • 68
  • 84
0

www. can only be pre-pended to a domain if it is pointing to the landing page. However, what you have here OYC (being the subdomain) being pre=pended by another subdomain of WWW.

Http:// is standard protocol to accessing a domain. It is there (or https:// which is a more secure connection) even though you don't see it in the browser.

Savion Smith
  • 46
  • 2
  • 9