Alabama governor Kay Ivey on Wednesday signed into law a bill that prohibits virtually all abortions, setting up what will likely become a protracted legal battle.