Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML, using a relative URL as a BASE URL?

Tags:

html

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

like image 721
Probocop Avatar asked Mar 28 '10 14:03

Probocop


People also ask

How do I link to a relative URL in HTML?

To link pages using relative URL in HTML, use the <a> tag with href attribute. Relative URL is used to add a link to a page on the website. For example, /contact, /about_team, etc.

How do you define an HTML base tag to specify base URL for all relative URLs in a document?

The <base> tag specifies the base URL and/or target for all relative URLs in a document. The <base> tag must have either an href or a target attribute present, or both. There can only be one single <base> element in a document, and it must be inside the <head> element.

How do you define a base URL for a webpage in html5?

The HTML base tag is used to specify a base URI, or URL, for relative links. This URL will be the base URL for every link on the page and will be prefixed before each of them. For example, if the URL specified by the base tag is “www.xyz.com” and then every other URL on the page will be prefixed by, “www.xyz.com/”.

What is base URL and relative URL?

A URL specifies the location of a target stored on a local or networked computer. The target can be a file, directory, HTML page, image, program, and so on. An absolute URL contains all the information necessary to locate a resource. A relative URL locates a resource using an absolute URL as a starting point.


1 Answers

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

like image 191
DVK Avatar answered Oct 05 '22 22:10

DVK