ma08
ma08

Reputation: 3744

What is the use of www in a http(s) URL?

What is the use of www in a url like http://www.foobar.com Does it add any information to the url?

Recently I have accessed a website using https://nameofthewebsite.com and the browser couldn't connect. Adding www made it work. Please explain the intricacies of this in a url.

Upvotes: 3

Views: 1543

Answers (1)

v010dya
v010dya

Reputation: 5848

In this case WWW is no different than any other subdomain. If you would attempt to go to https://someweirdstring.nameofthewebsite.com/ it wouldn't work just as well.

You cannot simply change the domain name and expect things to work.

If you examine DNS records you will see that each subdomain can actually be on a different server and can actually be controlled by a different person.

Many hosting providers will give you a third level domain in case if you don't have a regular one. So you may use http://something.yourhosting.com/ which will not be in any way related to http://yourhosting.com/ or http://www.yourhosting.com.

The debate on whether it is best to use WWW in domain names or to omit them creates many flamewars "in the internetz". Personally i am for its use, but here is an objective outline of the arguments:

Pro-WWW:

  • It allows to differentiate between different subdomains more easily. And that leads to a slightly easier way to do load balancing without an expansive setup (you can have www, www2, www3, etc; and redirect to the needed one).
  • Not everything that talks via HTTP or HTTPS is actually a part of WWW. You can setup a file server, after all there are PUT, DELETE, and other commands in HTTP. That server will not even talk to a browser.
  • It makes writing DNS records much easier. Bare domain name can be a pain in some situations.

Anti-WWW

  • Most people forget to write it, and it would be really confusing for some people to have different sites on www.example.com and example.com.
  • Most people only use the browser to talk via HTTP.
  • Most sites own their domain name, and can afford to get rid of unneeded third level domain name.
  • Load balancing can be done in other ways.

Both camps agree, that in today's world you should strive to have your site accessible under both bare domain and www domain (forwarding the user where needed). Unfortunately it costs money per domain to work with HTTPS, so many sites will only do one appoach, in order to save money.

Upvotes: 1

Related Questions