I agree, hitting is not the answer.
Have you considered using sign language? They say children as young as 3 months old can grasp ASL, because it is a different type of language and they can use it long before they have verbal skills. It makes things so much easier when they can tell you what's wrong, with basic signs that even adults can quickly learn.