A website showing url in browser addressbar : www.something.com/abc/def/ghi
.
When you view source any websites, anchor tags have relative hrefs like href="../jkl/mno"
When you click the link, how does browser determine that it has to load www.something.com/abc/jkl/mno
?
For example: browse https://alibabagroup.com/en/global/home --> Expand Investor Relations --> Inspect source of any link. e.g. a href="../ir/home"
--> Click the link --> Browser resolves this to "https://www.alibabagroup.com/en/ir/home" by replacing the "global/home"
portion
Also, it would be a great help if somebody knows how to achieve this programatically in C sharp ? Some function like below:
string ToAbsoluteUrl("https://alibabagroup.com/en/global/home", "../ir/home")
{
// Outputs as "https://alibabagroup.com/en/ir/home"
}