-2

What is difference between writing a URL (say google.com) http://www.google.com and http:\\www.google.com

6
  • it is basic thing to access web URL
    – user1140574
    Feb 22, 2012 at 6:38
  • 1
    @adi why You ask question like this? Feb 22, 2012 at 6:42
  • This seems like a very reasonable question. Feb 22, 2012 at 6:46
  • 1
    Maybe for someone with a Windows background? ;) en.wikipedia.org/wiki/Backslash
    – summea
    Feb 22, 2012 at 6:54
  • 1
    @lpa: well frankly even i was shocked when it was asked to me in an interview
    – adi
    Feb 22, 2012 at 13:57

5 Answers 5

6

The syntax for url's is this..

scheme://domain:port/path?query_string
1
  • 2
    Almost, it's actually scheme://domain:port/path?query_string#fragment_id ...
    – cha0site
    Feb 22, 2012 at 11:47
5

One works and the other doesn't.

1
  • There was no "why" in the OP question. :)
    – summea
    Feb 22, 2012 at 22:31
2

http:\\www.google.com is not valid URL address.

2
  • but it works in most of browsers like Google chrome and IE(doesn't work in Mozilla)
    – adi
    Feb 22, 2012 at 13:53
  • 2
    this because these browsers include auto-url-fix feature which can simply detect any invalid URL pattern and fix it...
    – Desolator
    Feb 22, 2012 at 15:03
2

Backslash is wrong. Do not use \ for URLs.

1
  • its \\ and not just backlash()..sorry for typing mistake
    – adi
    Feb 22, 2012 at 13:59
2

You can ask why http:##google.com or http:%%google.com is not working? Because it's built so. It's a kind of a rule: "for abc protocol write abc://"

1
  • @ShashankKadne answered perfectly.
    – shift66
    Feb 22, 2012 at 6:28

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