Jump to content

Wikipedia:Protocol-relative URL

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Codename Lisa (talk | contribs) at 12:26, 14 October 2015 (Added "In print"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A protocol-relative URL (PRURL) is the preferred method on Wikipedia for linking to a website that offers both HTTP and HTTPS, while HTTPS links should be used for HTTPS-only websites and HTTP links should be used for sites that don't support HTTPS at all.[1] For example, the Internet Archive supports both protocols and thus a PRURL should be used when linking to the site. A PRURL automatically uses either HTTP or HTTPS depending on the user's browser settings.

Example:

*[//archive.org Internet Archive]
generates

In citation templates, whether Citation Style 1 or Citation Style 2, protocol-relative URLs may be entered as |url=//www.example.com/.

Implementation

Although past consensus discussions agreed to use PRURLs, no consensus was decided about changing them on a site-wide basis such as with a bot (see 17 January 2014 close box below). Implementation has been on an individual article and editor basis.

In print

Protocol-relative URLs only make sense in hyperlinks in webpages. Once printed on paper, they are no longer protocol-relative. In other words, when a person reads //www.example.com/ from the paper and types it in a web browser, the browser has no preceding protocol to mimic. In Internet Explorer 11, Firefox and Google Chrome on Windows, the browser always assumes HTTP.

Policy discussions

Information

References