On Sat, Dec 27, 2008 at 11:25:57PM +0100, Christian Boltz wrote:
Hello,
(just going through the list archive, so don't be surprised that I answer a quite old mail ;-)
on Freitag, 12. Dezember 2008, Robert Lihm wrote:
On 12.12.2008, at 13:36, Peter Poeml wrote:
Would it make sense, in the future, to make use of a common base URL in the HTML head?
<base href="http://static.opensuse.org/hosts/www.o.o" />
Probably it could force problems with our Rails apps ... I found a contra after wie talked about this last time. But I can't remember now. We should ask abauer before wie change something.
Be warned that <base href=...> affects every link and file reference, even links like <a href="#section"> (interpreted as "http://static.opensuse.org/hosts/www.o.o/#section" to use the example above). This means all links have to be written as absolute links ("http://www.opensuse.org/page.html#section"), which can cause some headache on maintenance.
A very interesting catch. Thanks for sharing this.
I went to this loop on a Typo3 website I implemented. I had to use <base href> because of the realurl plugin which creates "nice" URLs for all pages. Fortunately Typo3 can automatically prepend all #section links with the current URL automatically, so things are quite easy there.
But: If you maintain your pages manually, this causes lots of work (rename a file? change all internal links!) and is more error-prone than prefixing images etc. with the static.opensuse.org path (you'll easily note a missing image ;-)
To make the story short: Unless you auto-generate all links, using a <base href> tag can cause some headache. I normally tend to avoid it.
Thanks! Peter -- Contact: admin@opensuse.org (a.k.a. ftpadmin@suse.com) #opensuse-mirrors on freenode.net Info: http://en.opensuse.org/Mirror_Infrastructure SUSE LINUX Products GmbH Research & Development