1

On several pages I saw in the last months following syntax for a address

<a href="//mynextpage.html">...</a>

What does this way of an url stay for? Is it a kind of wildcard for the protocol you have called this site?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Reporter
  • 3,897
  • 5
  • 33
  • 47

1 Answers1

6

It means, that the link reference uses the same protocol (http: or https:) like the current page. If you call the page with http: the link goes to http: as well, if you call the page with https: the link has https too.

This is most useful not only for links but for images, javascript and other external resources. It prevents problems with mixed (encrypted/unencrypted) content which provokes warnings in most browsers.

JSchirrmacher
  • 3,243
  • 2
  • 19
  • 27