tags:

views:

61

answers:

2

Is it possible to set a base url on a page with a relative value?

For example, I have two websites (website A and website B). For Website B it will be located at www.website-a.com/website-b. So could I set the BASE href as '/website-b/'?

Thanks

+3  A: 

No, base URL can not be relative. The closest reference I found was RFC 1808: http://www.freesoft.org/CIE/RFC/1808/13.htm and W3C

DVK
Okay thanks, I guess I could use a bit of PHP for the domain so I don't need to change anything when moving from dev to live. Thanks.
Probocop
@Probocol if you can use PHP for the domain, why not use it directly where you specify the links? `BASE` makes things that much harder to maintain on the long run.
Pekka
+3  A: 

Not possible according to W3C specs:

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

jholster