I just noticed that I can write //google.com instead of http://google.com and it still works.

Is that some kind of short-hand? Maybe it's something that's built in my browser (Chrome 14)?

Is it safe to use double-slash instead of http and https?

link|improve this question
You could probably just use google.com or superuser.com or codegolf.stackexchange.com – Rob Sep 29 '11 at 15:52
What @Rob said - I don't think ANY modern browser has required you to put in the http:// in like, 10 years - it's just assumed. (If you want a different protocol from HTTP you do have to enter it.) – Shinrai Sep 29 '11 at 15:53
The question was... why does it work? :D – daGrevis Sep 29 '11 at 15:58
You may also be interested in google then Ctrl+Enter. – RedGrittyBrick Sep 29 '11 at 16:09
@daGrevis: Magic. – grawity Sep 29 '11 at 16:59
show 2 more comments
feedback

1 Answer

up vote 4 down vote accepted

How something like // is handled by the browser will vary by browser. As the standard usage case is http:// and would work across all browsers without a problem.

That being said, the majority of browsers will attempt HTTP where possible since that is what the browsers are used most often for. It is also the safest choice, HTTP traffic is sandboxed as best as possible by the browser and should be more secure than assuming the address is local.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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