Pain from behind

The last time my boyfriend and I had sex, we done it doggy style. We had to stop a few seconds into it because my stomach would hurt so bad but if we went to any other position, I was fine. Any advice?