[REBOL] Re: url domain
From: antonr:iinet:au at: 7-Oct-2003 12:38
These are relative links.
So it looks, at least for this webserver, that
a relative link that begins with a slash means go
to the root first.
The resulting absolute links are:
1. http://www.rebol.net/cookbook/recipes/0032.html
2. http://www.rebol.net/graphics/doc-bar.gif
What you want is some sort of "clean-url" function,
similar to clean-path.
This function will know to go to the root directory
when it see a leading slash, and try to resolve
parent directory ../ markers too.
I believe you can't rely on this behaviour on all
web servers, though. If you are implementing your
own web server, then you will be the one deciding how it
works (!), or if you know the behaviour for a
particular site like rebol.net then it's ok.
To get the domain from an absolute url, try:
third parse url "/"
Anton.