Flask’s redirect() streamlines URL changes by sending users to new endpoints while preserving request context. It accepts a target URL and optional status code, defaulting to 302; 301 signals a permanent move, and 303 (rare today) means “see other.” Common uses include login/registration flows, URL shortening, and error handling, with simple patterns like using url_for to return users to the home page after actions.
