Handle url redirection