Just get a ticket on UA from your starting point to Montpellier. It is not rocket science, since airlines everywhere in the world work together for multi destination flights even when they are not in a marketing alliance. True, it might cost a bit more than getting separate tickets, but that is the price of a safe connection that will guarantee to get you to your destination even if you miss your original connection for some reason. It's better than completely losing the fare of the second ticket.