def replace_base_url_in_base_tag(index, base_url):
    """Replace base URL at base tag if present.

    Keyword arguments:
        index (string): An index for requested revision.
        base_url (string): A base URL to replace.

    Returns:
        An index with replaced `href` attribute at `base` tag`.

    """
    base = '<base href="'
    start = index.find(base)
    if start is -1:
        return index
    start += len(base)
    end = index.index('"', start)
    return index[:start] + base_url + index[end:]
