Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beginning external site links with "//" [duplicate]

Possible Duplicate:
Is it valid to replace with // in a <script src=“…”>?
Links start with two slashes

I've seen this on a few sites now. An easy example is to look at the Wikipedia landing page's source:

<link rel="shortcut icon" href="//en.wikipedia.org/favicon.ico" />
<link rel="apple-touch-icon" href="//upload.wikimedia.org/wikipedia/commons/f/f1/Wikipedia-mobile-icon.png" />
<link rel="copyright" href="//creativecommons.org/licenses/by-sa/3.0/" />

Is there some standard with starting external links with //? Is this just done to avoid having to download the extra https?: and save some characters because most browsers are smart enough to add the rest of the scheme on there own? Or is this a legitimate thing, maybe with some other reason?

like image 488
Explosion Pills Avatar asked Feb 10 '12 22:02

Explosion Pills


People also ask

What will happen if a website has some pages with duplicate content?

However, it does filter identical content, which has the same impact as a penalty: a loss of rankings for your web pages. Duplicate content confuses Google and forces the search engine to choose which of the identical pages it should rank in the top results.

Why must the web site have the same links in the same location as the previous page?

The redundancy may minimize individual differences: one person might notice the link at the top, while another person might notice it at the bottom.

How do I find the duplicate URL of a website?

To find details of specific URLs with technical duplicates, click on the blue URL Details button from the URL List. The URL Details tab will slide across, and you then need to navigate to Duplicate Content -> URLs, and you'll see all the duplicate URLs underneath.


1 Answers

That is usually called protocol-relative URLs and allows for the browser to download the resource using the same protocol as the page was being loaded with. So if the user had loaded the page through a https url, the resources specified with // will be loaded through https, otherwise they are loaded through regular http.

One thing it can help you prevent is the ugly user-unfriendly message in older versions of IE, stating that the page contains both secure and non-secure resources.

Paul Irish has written a good blog post about this:

  • The protocol-relative URL
like image 83
Christofer Eliasson Avatar answered Sep 28 '22 18:09

Christofer Eliasson