def relative_to_absolute(base, url):
    """ Transforms a relative URL in an absolute URL """

    if url.startswith('http'):
        return url
    elif url.startswith('/'):
        return base + url
    else:
        return base + '/' + url