500 error when the target contains ? in a URL