Not really.
Browsers don't just combine your base href attributes and relative URLs. Instead, the <base> sets the base URL of the document, which is then used to dynamically create a new path.
You can see an interesting example in the HTML WHATWG specification:
<base href="http://www.example.com/news/index.html"> <p>Visit the <a href="archives.html">archives</a>.</p>
Note that the href attribute ends only with the file name.
This means that if you donβt attach the trailing slash to the base href attribute, foo will be considered the last, mutable part of the path and will essentially be deleted. As an example:
<base href="http://www.example.com/news/index.html" /> <img src="ball.png" />
<base href="http://www.example.com/news/" /> <img src="ball.png" />
<base href="http://www.example.com/news" /> <img src="ball.png" />
<base href="http://www.example.com/" /> <img src="ball.png" />
<base href="/" /> <img src="ball.png" />
Denis source share