Say URL1: http://domainname.com/hi/hello/world/ilikethis.htm
RelativePath: ../../hello.htm
Hence absolute path is http://domainname.com/hi/hello.htm
Is there a function that do that?
Printable View
Say URL1: http://domainname.com/hi/hello/world/ilikethis.htm
RelativePath: ../../hello.htm
Hence absolute path is http://domainname.com/hi/hello.htm
Is there a function that do that?
Are you talking about Server side... If yes... then there are functions for example in php, to get the absolute path of current script file by magic constant
__FILE__
$_SERVER['PHP_SELF'] gives the relative path of the file from the ROOT directory
$_SERVER['DOCUMENT_ROOT'] gives the server path.
Now... there must be functions in ASP, JSP and other scripts to perform these functions on server side.
I am talking about client side. In vb.net
In general, if we look at a site http://domainname.com/soemthing/somewhere
and then there is a link there <a href="hithere.htm">
Clicking on the link will make us go to http://domainname.com/soemthing/somewhere/hithere.htm right?
How to turn http://domainname.com/soemthing/somewhere and hithere.htm into http://domainname.com/soemthing/somewhere/hithere.htm
Notice it also needs to be able to handle variants. Things like ../../hithere.html will produce http://domainname.com/hithere.htm
Never mind. URI constructors do that.