The first four of these are classified as primary headaches, groups 5-12 as secondary headaches, cranial neuralgia, central and primary facial pain and other headaches for the last two groups.The ICHD-2 classification defines migraines, tension-types headaches, cluster headache and other trigeminal autonomic headache as the main types of primary headaches. Also, according to the same classification, stabbing headaches and headaches due to cough, exertion and sexual activity (sexual headache) are classified as primary headaches. The daily-persistent headaches along with the hypnic headache and thunderclap headaches are considered primary headaches as well.Secondary headaches are classified based on their cause and not on their symptoms. According to the ICHD-2 classification, the main types of secondary headaches include those that are due to head or neck trauma such as whiplash injury, intracranial hematoma, post craniotomy or other head or neck injury. Headaches caused by cranial or cervical vascular disorders such as ischemic stroke and transient ischemic attack, non-traumatic intracranial hemorrhage, vascular malformations or arteritis are also defined as secondary headaches. This type of headache may also be caused by cerebral venous thrombosis or different intracranial vascular disorders.
People with progressively worsening headache also warrant imaging, as they may have a mass or a bleed that is gradually growing, pressing on surrounding structures and causing worsening pain. People with neurological findings on exam, such as weakness, also need further workup.The American Headache Society recommends using "SSNOOP", a mnemonic to remember the red flags for identifying a secondary headache:
Systemic symptoms (fever or weight loss)
Systemic disease (HIV infection, malignancy)
Neurologic symptoms or signs
Onset sudden (thunderclap headache)
Onset after age 40 years
Previous headache history (first, worst, or different headache)Other red flag symptoms include:

Old headaches
Old headaches are usually primary headaches and are not dangerous. They are most often caused by migraines or tension headaches. Migraines are often unilateral, pulsing headaches accompanied by nausea or vomiting. There may be an aura (visual symptoms, numbness or tingling) 30–60 minutes before the headache, warning the person of a headache. Migraines may also not have auras. Tension-type headaches usually have bilateral "bandlike" pressure on both sides of the head usually without nausea or vomiting. However, some symptoms from both headache groups may overlap. It is important to distinguish between the two because the treatments are different. The mnemonic POUND helps distinguish between migraines and tension-type headaches. POUND stands for: 
One review article found that if 4–5 of the POUND characteristics are present, a migraine is 24 times as likely a diagnosis than a tension-type headache (likelihood ratio 24). If 3 characteristics of POUND are present, migraine is 3 times more likely a diagnosis than tension type headache (likelihood ratio 3).