def encode_non_url_reserved_characters(url):
    # safe url reserved characters: https://datatracker.ietf.org/doc/html/rfc3986#section-2.2
    return urlquote(url, safe=":/?#[]@!$&'()*+,;=")
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.