Redirecting to the correct URL