correctly handle redirects that contain existing parameters