Thanks Anton

finally I will use 'parse to get the domain URL.

>> u: http://www.rebol.net/cookbook/index.html
>> parse u [thru "http://"; to "/" stop: to end (print copy/part u (index?
stop) - 1 )]
http://www.rebol.net
== true

I thought I read somewhere of some undocumented properties for URL (like
/user and /host for email).

Regards
Patrick
----- Original Message -----
From: Anton Rolls <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 07, 2003 4:38 AM
Subject: [REBOL] Re: url domain


>
> 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.
>
> > Hi List,
> >
> > Parsing an HTML page (http://www.rebol.net/cookbook/index.html) I
> > have found two kinds of link.
> >
> > 1. HREF="recipes/0032.html"
> > 2. IMG SRC="/graphics/doc-bar.gif"
> >
> > The first one refers to the current folder
> > "http://www.rebol.net/cookbook/"; .
> > The second one to the current domain "http://www.rebol.net/"; .
> >
> > Hence my question, is there an easy way to get the domain from an url?
> >
> > Regards
> > Patrick
>
> --
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
>

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to