Piet Souris wrote:If I leave out 'localhost/', both with the URL and the URI, I get this error:
Do you mean:
Yeah, that wouldn't work. When you write it like that, it interprets "
G" as a host name.
It's relatively easy to figure out how to construct an URL of any kind if you know a few simple rules. Most URLs are of one of the the following two variants:
Simply put, if you have two slashes after the scheme, then it means you will be specifying an authority. For the "
file" scheme, the authority is really just the domain name of the system that you want to retrieve the file from, and file URLs don't have a query nor a fragment.
Here are two examples:
Now, the reason that the URL that Carey gave would also work, is because it's allowed to specify an empty authority, which for the "
file" scheme means that the authority defaults to
localhost. So the following URLs are all equivalent: