checks if server redirects url

def check_if_redirect(url):
    """
    checks if server redirects url
    """
    response = head(url, headers={'User-Agent': USER_AGENT})
    if response.status_code >= 300 and response.status_code < 400:
        return response.headers['location']

    return None