views:

291

answers:

2

I have a site where I use the base tag. All the links in the site are relative, and I set an absolute href so that all the links should be aimed at the right target. And it works in Opera and Chrome. All links in the menu works, all images and style-sheets are found. But in Firefox and IE they are not. And I don't get it!

I can browse it without problems in Opera and Chrome. While in FireFox and IE, it is all messed up when I get to one of the pages that are in a sub-directory. Have I misunderstood something about how that tag is supposed to be used? Or?

This is the site: http://sites.geekality.net/vipersystem/

+1  A: 

The base tag only supports absolute paths in Firefox, it seems.

http://forums.mozillazine.org/viewtopic.php?f=38&t=366823&start=0&st=0&sk=t&sd=a
http://www.w3.org/TR/REC-html40/struct/links.html#edef-BASE

Ergo,

<base href = "http://sites.geekjuggler.net/vipersystem/" />

should work.

Stefan Kendall
Thank you! That looks much better. Stupid FF and IE...
Svish
Seriously. Viva la Opera.
Stefan Kendall
And when I think about it, I really think it is kinda rude to not consider `/vipersystem/` an absolute link. As far as I know, it isn't relative at least...
Svish
+1  A: 

From the HTML 4.01 specification: Base Element

href = uri [CT] This attribute specifies an absolute URI that acts as the base URI for resolving relative URIs.

However the HTML 5 draft drops the requirement that the Base element be an absolute URI, so I guess Opera and Chrome have already implemented that relaxation.

Alohci
Or just never had a correct implementation :)
Tomas Markauskas
A URI starting with a / is considered an absolute one though... or at least I thought it was. Maybe not absolute *enough*?
Svish
@Svish - HTML 4.01 defers to http://www.ietf.org/rfc/rfc2396.txt on the matter of URIs. Section 3 of that states "An absolute URI contains the name of the scheme being used (<scheme>) followed by a colon (":") and then a string (the <scheme-specific-part>) whose interpretation depends on the scheme."
Alohci
@Alohci: Aha, fair enough I suppose :)
Svish