import requests


def redirected(url, location):
    """Return True if url is redirected to location."""
    r = requests.get(url, allow_redirects=False)
    status = (r.status_code in (301, 302))
    redirect = ('location' in r.headers and r.headers['location'] == location)
    return all([status, redirect])