Forum Moderators: open
[w3.org...]
I don't think the characterization of BASE given in the thread you cite above is correct. This is perfectly acceptable, and is how I do it:
<base href="http://www.example.com" />
with all internal links on each page in the form:
<a href="/mydir/pageone.html">
etc.
Is it correct to close the tag like this />?
<base href="http://www.example.com" />
Would you mind to take a look again at the thread I cited [webmasterworld.com...] There are some new posts :)
[webmasterworld.com...]
The second issue is whether the BASE element helps clarify the www.domain.com vs. domain.com issue. Encyclo is correct that the most thorough way of doing this should be with an .htaccess rewrite directive; experience seems to show that this may take months to register with the search engines. Independent of that, however, using a BASE element and relative URLs will insure that all *internal* linking within your site has the same format (www or non-www, as you please). The BASE element will also insure that visitors will see the chosen form of the URL in their browsers when they mouseover a link, for example; I think that has some benefit. And if you ever move your entire site from one domain or directory to another, you can just search and replace the BASE element and you're done.
So in summary, I have found that using a BASE element, while optional, has some benefits. *Internally* it serves the same function as the htacess rewrite, but it can do nothing about how outside people link to you.
.htaccess is the common method to solve www and non www issue. - make sure it's a 301.