import requests


def is_valid_url(url):
    """
    Returns the redirected url if the url is valid
    Returns false otherwise.
    """
    try:
        request = requests.head(url, allow_redirects=True)
        if request.status_code == 200:
            return request.url
        else:
            return False
    except Exception as exp:
        print(type(exp))
        return False