encodeURIComponent the url upon redirect