I know absolute path-only URLs (/path/to/resource
) are valid, and refer to the same scheme, host, port, etc. as the current resource. Is the URL still valid if the same (or a different!) scheme is added? (http:/path/to/resource
or https:/path/to/resource
)
If it is valid according to the letter of the spec, how well do browsers handle it? How well do developers that may come across the code in the future handle it?
Addendum:
Here's a simple test case I set up on an Apache server:
resource/number/one/index.html
:
<a href="http:/resource/number/two/">link</a>
resource/number/two/index.html
:
two
Testing in Chrome 43 on OS X: The URL displayed when hovering over the link looks correct. Clicking the link works as expected. Looking at the DOM in the web inspector, hovering over the a href
URL displays an incorrect location (/resource/number/one/http:/resource/number/two/
).
Firefox 38 appears to also handle the click correctly. Weird.