Changing curl to follow http redirect