I recently needed to do a redirect in php using:
header("Location: http:/relative/path");
which seems to work in all the browsers I have available to me (Safari, Chrome, Firefox). This also works when used in a standard link:
<a href="http:/relative/path">Link to relative path</a>
My question is whether this is a fluke, or a formal implementation. I need to confirm to my superiors that this is a known standard.
Thanks!
A relative path refers to a location that is relative to a current directory. Relative paths make use of two special symbols, a dot (.) and a double-dot (..), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy.
A relative URL is a URL that only includes the path. The path is everything that comes after the domain, including the directory and slug. Because relative URLs don't include the entire URL structure, it is assumed that when linking a relative URL, it uses the same protocol, subdomain and domain as the page it's on.
Absolute and relative paths in script tools You can also set this option by right-clicking the script tool, clicking Properties, then clicking the General tab. At the bottom of the dialog box, check Store relative path names (instead of absolute paths).
Img src Not Working That means, when a web page loads, the browser has to retrieve the image from a web server and display it on the page. The broken link icon means that the browser could not find the image. If you've just added the image, then check that you included the correct image URL in the source attribute.
Per RFC 3986, under Section 4.2 or appendix A:
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
where hier-part can be "//" for authority path-abempty, "/" path-absolute, path-rootless or path-empty.
If you think about it, when you use "http://", the "//" denotes the root of the available path. That's why different protocol schemes don't need it like Skype. It uses "skype:echo123?call" which will call the user "echo123". No "//" needed since there is no "root".
So yes, it's valid. But since that exact usage is a little off the normal pattern setup in today's browsers, your milage may vary. It does work in IE9.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With