I could use a working example that fixes this issue.
What exactly should be fixed here? This is a correct result, you might have expected something else but a 301 response is allowed and makes sense. Don't expect your Arduino to behave like a browser and interpreting the returned response automatically.