Forum Moderators: open

Message Too Old, No Replies

Whither <base href...>?

To be deprecated?

         

zCat

6:31 pm on Mar 12, 2005 (gmt 0)

10+ Year Member



In the mega-thread on googlejacking it's mentioned several times that the <base href...> tag
might or might not help against the problem, e.g. [webmasterworld.com...]

It's also claimed <base href...> will be obsoleted in future HTML versions. Is there any substance to this?

I've just implemented the tag on my site (mainly for experimental purposes), and it validates as XHTML 1.0 strict.

Also, are there any real practical benefits of using <base href...>? AFAICS it falls into the "nice-to-have" category, but will it make my pages user/browser/bot-friendlier?

Whatever, I'll be going over to using absolute URLs soon anyway, just to be on the safe side :-))

[edited by: tedster at 6:51 pm (utc) on Mar. 12, 2005]
[edit reason] fix formatting [/edit]

encyclo

6:48 pm on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Claims of obsolescence regarding the
<base ...>
element are highly exaggerated: it will become extinct when HTML becomes extinct, in which case you'll need to redo your document anyway. The document quoted in the other thread is simply wrong. As you've seen the following syntax:

<base href="http://example.com/">

Is valid for both strict and transitional doctypes (add the trailing slash for XHTML).

The syntax

<base target="whatever">
(as used in a framed document) is only valid with a transitional doctype - but that's not the one we are concerned with when it comes to the page-jacking problem.

The advantage would come when someone steals a page and doesn't edit the source code: all links on that page would correctly resolve to your site and not their copy.

zCat

12:07 am on Mar 17, 2005 (gmt 0)

10+ Year Member



encyclo, Thanks for the reply. (Sorry for the delay, I lost track of the thread). And thanks to tedster for the formatting. (I've gotten used to blog software and the like that formats multiple lines into paragraphs).

With your answer, and reading a bit further, I found I hade a misconception about the function of the tag; I thought it was the base URL of the site, not the page. Putting the page URL in is definitely a Good Thing TM.

ownerrim

5:36 pm on Mar 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



zcat, forgive me if I sound clueless which I am---are you saying that if you install base href on a page it needs to refer to the url of that specific page (http://www.widget.com/aboutwidgets.html) and not to the url of the site itself (http://www.widget.com)?