generate the redirect url