def format_rel_url(url):
    """ Formats from the form path/to to /path/to, if required.

    @return: formatted string
    @rtype: string
    """
    if not url:
        return url
    if not url.startswith('/'):
        return '/%s' % url
    else:
        return url