import re


def make_relative_path(path):
    """Returns the path for a file, relative to the paste ID.

    >>> make_relative_path('pasty/1999/12/31/123/1/foo.html')
    '1/foo.html'
    """
    match = re.search(r'^pasty/\d{4}/\d{1,2}/\d{1,2}/\d+/(.*)', path)

    if match:
        return match.group(1)
    else:
        raise ValueError('Invalid file path')