new method to dynamically generate a redirect URL