"What happened to you" is more common phrase and probably the one you want, a simple question about a series of events. "what did happen to you" the emphasis is on DID impliying that whatever happened is secretive or misconstrued and you are trying to get the truth