This is an interesting question, but it cannot be answered on the Internet. If you have a headache from wine in general, it may be alcohol, which raises intracranial pressure. If it comes from any red wine, then perhaps it is a matter of specific compounds that are in red, but not in white wine. If it comes from the occasional red wine, then it may be a combination of external factors, your physical condition and the composition of the offending wine. In any case, a specialist doctor will help, mri, chemical analysis of the drink and a meteorological report for the day, it is pointless to guess.
This can be an allergic reaction to both methanol (methyl alcohol) and a preservative - sulfites, which is usually more in reds than in whites.
It is not surprising, but the head hurts less from a pure product than from "chemistry". This is the beauty of vodka, basically there is a difference only from the degree of purification, which cannot be said about various multi-colored alcoholic drinks. I would advise you to either change the price segment in which you take wine or look on the forums for advice on what to take in this price category. Of course, there is an option when in reality the activity of enzymes can be lowered, this happens when there is a lack of acetaldehyde dehydrogenase and at the same time the intermediate product acetaldehyde has a toxic effect.