Or you could try adding Elete drops to your water. It's pretty inexpensive and a good way to stay on top of your electrolytes. If you sweat a lot or it's hot outside, you're definitely going to need salt in your system before the two hour mark.

I used to get horrible headaches that were worsened by the sun and/or exercise. In the end, they ended up being tension related, but were so painful I didn't want to do anything at times. Do you get these headaches at any other times? In my experience, poor bike fit or weak upper body muscles can cause headaches on the bike, but generally you will feel where the trigger point is (neck or shoulders usually) and what muscle is unhappy, not just a headache.