MakeRelativeLinkFromURL (open)

Convert an absolute URL to a relative one, if at all possible

Syntax

LOADLIB "wh::internet/urls.whlib";

STRING FUNCTION MakeRelativeLinkFromURL(STRING current_url, STRING convert_url, STRING scope)

Parameters

STRING current_url

Current page URL

STRING convert_url

URL to try to convert to a relatve

STRING scope

Optional: scope within which to make the URL relative ("", "protocol" or "root")

Return value

STRING

Relative URL, if it was possible to make it. Otherwise, this function returns the original 'convert_url'