def joinUri(uri, *segments):
    """Append segments to URI.
    
    Example: joinUri("/a/b", "c", "d")
    """
    sub = "/".join(segments)
    if not sub:
        return uri
    return uri.rstrip("/") + "/" + sub