[uf-discuss] URLs in hrefs

Brian Suda brian.suda at gmail.com
Mon Apr 23 05:22:25 PDT 2007


On 4/23/07, Michael Smethurst <Michael.Smethurst at bbc.co.uk> wrote:
> But the question remains:
> Microformats aside, if I'm making a new website from scratch (no legacy
> code/markup) and I want to encourage others to hack, mashup, interwingle it
> with other data is it best to use /radio4 or http://www.bbc.co.uk/radio4
> ?

you can have the best of both worlds. In each <a href=""> just use
"/radio4". This makes the link relative. But then you can also add a
<base href="http://bbc.co.uk/"> when this is in your HTML it will make
all the hrefs absolute (or it should for any decent parser).

The advantage of using the <base> element is that you can easily
switch it to something like <base href="http://my-dev-site.bcc.co.uk">
and you don't have to rewrite all the hrefs within the HTML.

-brian

-- 
brian suda
http://suda.co.uk


More information about the microformats-discuss mailing list