Headaches and migraine are often caused by gluten
A significant proportion of people with migraine may have coeliac disease and gluten sensitivity.
Consequently, a gluten-free diet may lead to an improvement in the migraine in these people. A very high prevalence of headache (migraine and/or tension headaches) was also found in coeliac disease patients (46%) when compared with a control group (29%) (Cicarelli, 2003).
It is well know that foods can trigger headache/migraine. Gluten is the prime suspect.
(Suggested reading to find out more: Gluten Brains: the brain-grain connection)