def url_to_filename(base, url):
    """Return the filename to which the page is frozen.

    base -- path to the file
    url -- web app endpoint of the page
    """
    if url.endswith('/'):
        url = url + 'index.html'
    return base / url.lstrip('/')