1,675. The Dissolution of Prohibited Marriages
Hilchos Ishus 24:1
Let's say that a man who marries a congenitally infertile woman has no children, nor does he have another wife with whom to have children. Even though they must divorce, the same financial details apply to this woman as to all others: she is entitled to the baseline amount of her kesubah as well as all of its conditions. He likewise enjoys the same financial arrangements with her as he would with any other woman.
Hilchos Ishus 24:2
If a man married a woman without being aware that she was congenitally infertile and it was only discovered later, or if it was discovered that the marriage is prohibited because it violates a Torah prohibition, then she is not entitled to the baseline amount of the kesubah nor to its conditions, though she is entitled to the extra amount that her husband added on to the baseline amount. She is not entitled to maintenance, not even if he dies. Such a couple is forced to divorce; the value of the produce that the husband enjoyed is not seized from him. The same applies when a man marries a second-degree (rabbinic) prohibition regardless of whether or not he was aware of the situation at the time of the marriage.