• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

what is the difference b/w http://lge.com and www.lge.com

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How are you?
i would like to know what is the difference b/w "http://lge.com"; and "www.lge.com".

check this example:

http://my.lge.com
this is not opening like "www.my.lge.com"

why the people hosting some of the sites like www.domainname.com
and some of the sites like http://domainname.com
please check the above example.
 
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really nothing to do with Java, but I'll have a quick go at this one.

The two examples given are completely different URLs. However, many browsers use heuristics to try to guess what the user meant, when given an incomplete URL.

For instance, if there's no protocol in the URL, as is the case with "www.lge.com", a browser may guess that the user meant "http://www.lge.com".

Most Web sites have a host name that starts with "www". However, that is only a convention and it is perfectly possible to have host names that start with something else. The URL "http://lge.com"; is a plausible Web site URL, with the host "lge.com". However, if a browser finds that there is no Web site that that URL, it may guess that the user meant "http://www.lge.com".

Such guessing heuristics typically will not be available in Java. If you want to open a Web site in Java code, you will typically need to give a full URL, with correct protocol and host name.
 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a thing in the world to do with servlets, so moved to General Computing.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one more point to add:

The sites sometimes are NOT very clever that they buy the Domain Name www.xyz.org instead of xyz.org so that unless you give explicitly the one starting with www., you cannot reach the site.

(also I guess, related with the configuration of either the client software and/or server on which the site is being hosted.)
But the thing is that, one should get the domain-name without the www while buying.
 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic