Hello. Thank you for coming to JustAnswer with your question, and welcome.
It is highly unlikely that water gives you headaches. More likely, the headaches are caused by drinking less of the diet soda or other things you prefer especially if they contain caffeine. These types of drinks are really not good for you. Diet soda has been found to cause weight gain in people as well as regular soda and other sugary drinks.
Your body needs hydration, and water is the best source. If you do not like the taste of it, you can add some fruit juice (lime, lemon, peach nectar, etc) to flavor it. But you should definitely drink more water and less of the other things.
You should gradually change from your routine fluids to more and more water, until you are drinking about 2 quarts of water a day. Other healthy fluids would include real fruit juice, though it should be diluted and used sparingly because of the natural sugar content. Milk, lowfat or nonfat (2-3 cups per day) for the calcium/magnesium and vitamin D it contains. And herbal teas, just because it is a good way to get in more water without sugar and caffeine. If you need caffeine, there is nothing wrong with a couple of cups of coffee per day, or better--green or orange pekoe tea.
Headaches can be caused by a lack of water or dehydration. But if you are not used to drinking an adequate amount of water, it will take you body a few days or so to adjust to a more normal fluid intake.
I'm sorry, I did not say that your headache problem is *solely* related to caffeine. I just meant that many times people who drink soda to the exclusion of water often prefer caffeinated beverages.
If you drink any caffeinated beverages on a regular basis, then not drinking it at the normal time for you may give you a headache.
I think your headaches when you drink water may be coincidental, if the caffeine issue is not the case.
In any case, you do need more water. Also, you need to "pee". Your kidneys need water to work with, which will keep them healthy and functioning properly for many years. All of your body's processes need water to function properly, otherwise you will start to feel sick. Your headaches may be an early indication of this.
If your headaches are truly only happening when you drink water, I think you should see your doctor to be evaluated for some electrolyte problems (specifically sodium, maybe potassium), or a syndrome that affects your body's fluid and electrolye balances.
There is nothing in water that could possibly cause a headache otherwise. But if your sodium is affected (for instance) by drinking water, it could cause a headache.