Miralax is also safe during pregnancy, and walking a lot helps too!
Make sure you are drinking enough water for you to have proper hydration and bowl movements. You need to be consuming 3,500 ml of water a day. Sounds like a lot, but this will minimize cramping, headaches, and constipation; and naturally will help increase urination and flush out toxins in your body. I was having these same problems around 25 weeks, and a friend recommended a herbal tea by Yogi called "get regular." It is caffeine free, and will help relieve you completely. If I'm having any BM issues, I drink it at night before bed, and it works the next morning. Hope this helps, you can find it at Target or order it on Amazon.