Compute name of URL relative to a base URL
This function is a convenience function for computing the fullly qualified URI of a document relative to a base URL. It handles the case where the document is already fully qualified and so ignores the base URL or, alternatively, is a relative document name and so prepends the base URL. It does not (yet) try to be clever by collapsing relative directories such as "..".
the location of the target document whose fully qualified URI is to be determined.
the base URL relative to which the value of
the separator to use to separate elements of the path. For external URLs (e.g.
accessed via HTTP, HTTPS, FTP), / should be used. For local files on Windows machines
one might use
a logical controlling whether we prepend the base URL to the result.
a logical value that controls whether we attempt to
simplify/normalize the path to remove
This uses the function
parseURI to compute the components
of the different URIs.
A character string giving the fully qualified URI for
Duncan Temple Lang
parseURI which uses the libxml2 facilities for parsing URIs.
XInclude and XML Schema import/include elements for computing relative locations of included/imported files..
1 2 3 4 5
getRelativeURL("http://www.omegahat.net", "http://www.r-project.org") getRelativeURL("bar.html", "http://www.r-project.org/") getRelativeURL("../bar.html", "http://www.r-project.org/")
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.