Be well hydrated and try different forms of exercise to see if some things are better than others. Don't overdo it at first and see where your limits are. If you're exercising outside or in bright light, wear sunglasses. There are migraine prevention medications, so if all else fails, discuss that with your doctor. The good news is that exercise and being in good shape ultimately prevents migraines, so they may lessen over time.