Forum Moderators: open

Message Too Old, No Replies

Should the <base> href be the same for each page?

Me and the <base> again

         

iaaa

4:21 pm on May 8, 2006 (gmt 0)

10+ Year Member



Hi,

My question is about the base tag; Say we got a website with the following structure:

http://www.example.com/
http://www.example.com/topic1/
http://www.example.com/topic1/page1
http://www.example.com/topic1/page2
http://www.example.com/topic6/

a) Should the base tag be the same for all of the above pages as:

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

b) Or should it be

<base href="http://www.example.com/">
<base href="http://www.example.com/topic1/">
<base href="http://www.example.com/topic1/page1">
<base href="http://www.example.com/topic1/page2">
<base href="http://www.example.com/topic6/">

respectively and unique to each page? (I am also using multiviews for content negotiation, hence the omitted extensions for the .html files)

Regards

tedster

5:42 pm on May 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your second example is the correct one. The <base href=""> tag states what the "base" url should be for the browser or spider to use in figuring relative links on the page. The first example would not work for any pages within a subdirectory because the subdirectory vanishes and you get a 404.