Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser support for URLs beginning with double slash

People also ask

Is double slash valid in URL?

A double slash in the URL path is valid and will respond in the browser, but is typically unwelcome, as this could cause duplicate content issues if the CMS delivers the same content on two URLs (i.e. single slash and double slash).

How do you fix a double slash in URL?

If the double slash in the page's permalink is generated by your CMS, you might need to address your developer for help. If the URL with a double slash is indexed in Google or has incoming external links, you can set the proper 301 redirects to the corrected URL.

Why there is double slash after HTTP?

The authority component is preceded by a double slash ("//") […] This is also why not all URIs contain the double slash: because not all URIs have an authority component (e.g., URIs using the mailto scheme, the xmpp scheme, etc.).

What is double slash in HTML?

The "two forward slashes" are a common shorthand for "request the referenced resource using whatever protocol is being used to load the current page".


This behavior was part of RFC 1808 (Section 4) which is about 16 years old, so every major browser should (and does) support this.

Sadly, there's a bug with IE7 and -8 that will make them download the resources twice if a protocol-relative URL is used on a link or @import - which shouldn't be a big problem, but is ugly and should be kept in mind.


If you are developing on a local machine there's possibility it will fail with src="file://host.com/filename".

In this situation you need to specify scheme explicitly: http://host.com/filename or https://host.com/filename.