0

I found lots of sites using <a href='//foo.com'> instead of <a href='http://foo.com'>

Is there any difference?
What are the benefits?

When using // instead of http://, is it possible to direct them to https://?

taesu
  • 4,482
  • 4
  • 23
  • 41
  • 1
    I think this has been answered before: [http://stackoverflow.com/questions/9358609/why-do-i-keep-seeing-instead-of-http-for-resources-lately][1] [1]: http://stackoverflow.com/questions/9358609/why-do-i-keep-seeing-instead-of-http-for-resources-lately – Mark Kelly Jan 31 '15 at 23:46

1 Answers1

0

It is a protocol-relative URL. Every URL such as this inherits parent document's protocol (HTTP or HTTPS). Useful if you want to serve both versions of webpage.

zakjan
  • 2,391
  • 1
  • 19
  • 29